Salesforce Certified B2B Commerce Developer Practice Test - Questions Answers, Page 8
List of questions
Question 71

Which event should be triggered when user facing info, warning or error messages need to be displayed on a Visualforce page?
Explanation:
The event that should be triggered when user facing info, warning or error messages need to be displayed on a Visualforce page is pageMessage. This event is triggered by the displayPageMessage method of the CCRZ.util class, which is a utility class that provides various helper methods for common tasks. The event can be used to display a message on the page with a specified type, title, and text. For example,CCRZ.util.displayPageMessage('error', 'Oops!', 'Something went wrong.')will trigger the pageMessage event and display an error message on the page. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Events,Util Class
Question 72

Which format is the custom Salesforce field with the API name
'My_Fiels_Name__c' transformed onto by default in Salesforce B2B Commerce?
Explanation:
The format that the custom Salesforce field with the API name My_Field_Name__c is transformed onto by default in Salesforce B2B Commerce is myFieldName. This is done to follow the JavaScript naming convention and to avoid conflicts with the standard Salesforce fields and relationships. The transformation rules are as follows:
Remove any namespace prefix from the field name, such as ccrz__ or cloudcraze__.
Remove any underscores from the field name and capitalize the first letter of each word after an underscore, such as MyFieldName.
Lowercase the first letter of the field name, such as myFieldName. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Query Transformation
Question 73

Which format is the custom Salesforce relationship with the API name,
'My_Relationship_Name__r.My_Name__c' queried and transformed into dy default in
Salesforce B2B Commerce?
Explanation:
The format that the custom Salesforce relationship with the API name, My_Relationship_Name__r.My_Name__c is queried and transformed into by default in Salesforce B2B Commerce is myRelationshipName.myName: value. This is done to follow the JavaScript naming convention and to avoid conflicts with the standard Salesforce fields and relationships. The transformation rules are as follows:
Remove any namespace prefix from the field name, such as ccrz__ or cloudcraze__.
Remove any underscores from the field name and capitalize the first letter of each word after an underscore, such as MyRelationshipName and MyName.
Lowercase the first letter of the field name, such as myRelationshipName and myName.
Use a dot (.) to separate the relationship name and the field name, such as myRelationshipName.myName.
Use a colon (:) to separate the field name and the field value, such as myRelationshipName.myName: value. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Query Transformation
Question 74

Which Global JavaScript Object should be extended when writing custom Remote Actions?
Explanation:
The Global JavaScript Object that should be extended when writing custom Remote Actions is CCRZ.cc. This object contains all the Remote Actions that are defined in the cloudcraze managed package, which can be overridden or extended by subscriber code. The object also provides a mechanism for registering custom Remote Actions that can be invoked by the user interface components. For example,CCRZ.cc.customAction = function(params, callback){ // do something }will define a custom Remote Action named customAction that can be called byCCRZ.cc.customAction(params, callback). Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Remote Actions
Question 75

Which handlebars helper expression is used in Salesforce B2B Commerce pages and components to toggle the display of a block of markup?
Explanation:
The handlebars helper expression that is used in Salesforce B2B Commerce pages and components to toggle the display of a block of markup is {{#ifConfig 'Field__c'}} ... {{/ifConfig}}. This expression will evaluate the value of the configuration setting with the API name Field__c and render the block of markup if the value is true, or skip it if the value is false. For example,{{#ifConfig 'CO.showMiniCart'}} ... {{/ifConfig}}will render the mini-cart div only if the configuration setting CO.showMiniCart is true. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Handlebars Helpers
Question 76

Which handlebars helper function is used on Salesforce B2B Commerce pages and components for formatting price values?
Explanation:
The handlebars helper function that is used on Salesforce B2B Commerce pages and components for formatting price values is formatPrice. This function will format a numeric value as a price according to the currency settings and locale of the storefront. For example,{{formatPrice price}}will format the price value as $1,234.56 for US dollars or 1.234,56 for euros. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Handlebars Helpers
Question 77

Which method is used to override when extending the Salesforce B2B Commerce logic providers?
Explanation:
The method that is used to override when extending the Salesforce B2B Commerce logic providers is doLogic. This method is responsible for executing the business logic for each logic provider class, such as validating inputs, performing calculations, applying rules, or updating data. By overriding this method, the user can modify or extend the existing logic or add their own custom logic. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Logic Classes
Question 78

Which method needs to be implemented when rendering a Salesforce B2B Commerce view in order to have it called after rendering has finished?
Explanation:
The method that needs to be implemented when rendering a Salesforce B2B Commerce view in order to have it called after rendering has finished is postRender. This method is an optional hook that can be defined by the user to perform any actions or logic that depend on the view being rendered, such as initializing widgets, binding events, or updating the user interface. The method will be called by the render method of the CCRZ.View class, which is the base class for all views in the framework. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,View Class
Question 79

Which method signature is used in the Global API's?
Explanation:
The method signature that is used in the Global API's is ccrz.cc_Output (ccrz.cc_Input input). This signature indicates that the Global API methods take a single input parameter of type ccrz.cc_Input and return an output of type ccrz.cc_Output. These are custom classes that are defined in the cloudcraze managed package and contain various properties and methods for handling the input and output data. For example,ccrz.ccServiceProduct.getProducts(ccrz.cc_Input input)is a Global API method that takes an input object and returns an output object containing product data. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,API Classes,cc_Input Class,cc_Output Class
Question 80

Which out of the box Salesforce B2B Commerce page can give instructions to web crawlers from accessing specific Salesforce B2B Commerce pages?
Explanation:
The out of the box Salesforce B2B Commerce page that can give instructions to web crawlers from accessing specific Salesforce B2B Commerce pages is cc_RobotsTxt. This is a Visualforce page that generates a robots.txt file, which is a text file that tells web crawlers which pages or files they can or can't request from a site. The page uses the configuration settings CO.RobotsTxtAllow and CO.RobotsTxtDisallow to specify which paths are allowed or disallowed for web crawlers. For example,User-agent: * Disallow: /CCCartwill instruct web crawlers to not access the CCCart page. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Robots.txt File
Question