Salesforce Certified B2B Commerce Developer Practice Test - Questions Answers, Page 6
List of questions
Question 51
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What are three advantages of using ccLog over the Salesforce standard System.debug class? (3 answers)
Explanation:
Three advantages of using ccLog over the Salesforce standard System.debug class are:
There is no need to use string concatenation to easily tag log statements with a subject. ccLog allows passing a subject parameter to the log method, which will prepend the subject to the log message. For example,ccLog.log('This is a message', 'Subject')will log[Subject] This is a message.
There is no need to create a User Trace Flag. ccLog can be enabled by setting the value of CO.logToken to true in CCAdmin, which will activate logging for all users who access the storefront.
There is no need to manually set a cookie to debug with the Site Guest User. ccLog can be enabled for the Site Guest User by appending #ccLog=<Logging Token Name> to the end of the storefront URL in order to get logs in the inspector console. For example,https://my-storefront.com/#ccLog=debugwill enable logging for the Site Guest User with the debug level. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Logging
Question 52
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What are three ways to implement custom post Order processing? (3 answers)
Explanation:
Three ways to implement custom post Order processing are:
Extend cc_hk_invoice to handle custom business logic post Order processing. This hook allows modifying the invoice data or performing additional actions after an Order is placed. For example, the hook can send an email notification or update a custom field on the invoice record.
Use cc_hk_Order.placeTarget to define a new Order Confirmation page which executes additional business logic. This hook allows specifying a custom Visualforce page that will be displayed after an Order is placed. The custom page can include additional business logic or user interface elements.
Use Process Builder to implement business processes that execute when an Order record is created. Process Builder is a tool that allows creating workflows and actions based on criteria and conditions. For example, Process Builder can create a task, send an email, or update a record when an Order record is created. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Hooks, Process Builder
Question 53
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What are three ways to test the value of Page Label on any Salesforce B2B Commerce Community Page? (3 answers)
Explanation:
Three ways to test the value of Page Label on any Salesforce B2B Commerce Community Page are:
Execute CCRZ.pagevars.pageLabels['PAGE_LABEL_NAME'] in the JavaScript console. This will return the value of the page label with the given name from the pagevars object, which contains all the page labels that are used on the page.
Execute CCRZ.processPageLabelMap('PAGE_LABEL_NAME') in the JavaScript console. This will return the value of the page label with the given name from the pageLabelMap object, which contains all the page labels that are defined in CCAdmin.
Enable the 'display page label names' in cc admin. This will display the name of each page label next to its value on the storefront pages, which can help identify and verify the page labels. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Page Labels
Question 54
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What are two guidelines for logging that are used within the core Salesforce
B2B Commerce product? (2 answers)
Explanation:
Two guidelines for logging that are used within the core Salesforce B2B Commerce product are:
The close method of ccrz.ccLog must be called at the end of the remote action. This method will flush the log messages to the browser console or to a custom object, depending on the logging mode. If this method is not called, the log messages may not be displayed or saved properly.
No calls to ccrz.ccLog can be made before cc_CallContext.initRemoteContext is executed. This method will initialize the call context object, which contains information such as the current user, cart, storefront, and configuration settings. These information are required for logging, so calling ccrz.ccLog before initializing the call context will result in an error. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Logging
Question 55
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is a best practice when passing query parameters from user interface to an apex controller?
Explanation:
A best practice when passing query parameters from user interface to an apex controller is to query parameters should be properly sanitized by using JSINHTMLENCODE within the VisualForce Page or Component. This function will encode any special characters in the query parameters to prevent cross-site scripting (XSS) attacks or SOQL injection attacks. For example,ccrz.ccRemoteActions.getProducts('{!JSINHTMLENCODE(searchTerm)}')will encode the searchTerm parameter before passing it to the apex controller. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Security
Question 56
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is a method to resolve if the current storefront customer is a Salesforce B2B Commerce guest user in an apex class?
Explanation:
A method to resolve if the current storefront customer is a Salesforce B2B Commerce guest user in an apex class is to use ccrz.cc_CallContext.isGuest. This property will return true if the current user is a guest user, or false otherwise. For example,if(ccrz.cc_CallContext.isGuest){ // do something for guest user }will execute some logic only for guest users. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Call Context
Question 57
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is a valid way of referencing the CC Cart Object whose API name is E_Cart__c in a SOQL query?
Explanation:
A valid way of referencing the CC Cart Object whose API name is E_Cart__c in a SOQL query is to use ccrz__E_Cart__c. This is the transformed name of the object that is used by the Salesforce B2B Commerce framework. All custom objects and fields that are part of the cloudcraze managed package have the prefix ccrz__ in their API names. For example,SELECT Id, Name FROM ccrz__E_Cart__cwill query the CC Cart Object records. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Query Transformation
Question 58
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is a valid way of referencing the global cc_api_CartExtentsion apex class via subscriber code?
Explanation:
A valid way of referencing the global cc_api_CartExtension apex class via subscriber code is to use ccrz.cc_api_CartExtension. This is the name of the class that is defined in the cloudcraze managed package. The class is global, so it can be accessed by subscriber code. The other options are either invalid or incorrect. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,API Classes
Question 59
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is default behavior for how theSalesforce B2B Commerce Global APIs transform Salesforce data?
Explanation:
The default behavior for how the Salesforce B2B Commerce Global APIs transform Salesforce data is to return field names with a lowercase first letter, camelcase convention. For example, the field name ccrz__E_Product__c in Salesforce will be transformed to eProduct in the API. This is done to follow the JavaScript naming convention and to avoid conflicts with the standard Salesforce fields and relationships. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Query Transformation
Question 60
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is essential for a Salesforce B2B Commerce theme to show up in the theme section in CC Admin?
Explanation:
An essential requirement for a Salesforce B2B Commerce theme to show up in the theme section in CC Admin is that the theme needs to have ''theme'' in the name of the Static Resource. For example, a theme named ''MyTheme'' will not appear in CC Admin, but a theme named ''MyTheme_theme'' will. This is how the framework identifies which static resources are themes and which are not. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Themes
Question