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

Which two different types of services do Salesforce B2B Commerce APIs leverage? (2 answers)
Explanation:
Two different types of services that Salesforce B2B Commerce APIs leverage are:
Logic services which are responsible for implementing business logic associated with entities. These services are defined in the logic classes, such as ccrz.ccLogicCart, ccrz.ccLogicOrder, or ccrz.ccLogicProduct. These classes provide methods for validating inputs, performing calculations, applying rules, or updating data for each entity.
Data services which are responsible for querying and transforming data from entities. These services are defined in the service classes, such as ccrz.ccServiceCart, ccrz.ccServiceOrder, or ccrz.ccServiceProduct. These classes provide methods for creating, reading, updating, and deleting data for each entity. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Service Classes,Logic Classes
Question 92

Which two Salesforce B2B Commerce visualforce pages must be enabled at a Salesforce Community level to make the out of the box SEO functionality available? (2 answers)
Explanation:
Two Salesforce B2B Commerce Visualforce pages that must be enabled at a Salesforce Community level to make the out of the box SEO functionality available are:
CCSizeIndex: This page generates a sitemap.xml file, which is a file that lists all the pages and resources on a site that can be crawled by web crawlers. The page uses the configuration settings CO.SiteMapIncludeProducts and CO.SiteMapIncludeCategories to specify which products and categories should be included in the sitemap.
CCCatSiteMap: This page generates a category sitemap file, which is a file that lists all the categories on a site that can be crawled by web crawlers. The page uses the configuration setting CO.SiteMapCategoryDepth to specify how many levels of subcategories should be included in the category sitemap. Salesforce
Reference:B2B Commerce and D2C Commerce Developer Guide,Sitemap Files
Question 93

Which two statement are true for Mass Order (2 answers)
Explanation:
Mass Order pricing is done via a batch job, which means that the prices are not calculated in real time, but rather at a scheduled time. Mass order works with the variation product, which is a product that has multiple SKUs with different attributes, such as size or color. Mass order does not work with the default wishlists, which are used to store products that the customer wants to buy later. Mass order is not mobile ready with the ccrz templates, which are the default templates for the storefront pages. Salesforce
Reference:B2B Commerce Developer Guide: Mass Order,B2B Commerce Developer Guide: Variation Products
Question 94

Which two statements are true about Global API's in Salesforce B2B Commerce? (2 answers)
Explanation:
Global APIs are methods that can be called from any Apex class or Visualforce page within the B2B Commerce managed package or subscriber code. Each global API method takes in a Map<String, Object> as a single parameter and returns a Map<String, Object>. This allows for flexibility and extensibility of the API. Global APIs are versioned, which means that they have a version number in their name, such as ccApi_1_0. This ensures backward compatibility and allows for new features and enhancements to be added without breaking existing functionality. Global APIs do not catch any Exceptions that are thrown as part of missing parameters, which means that the caller is responsible for handling any errors or validations. Global APIs do not handle Transaction scope, and the Subscriber calling it does not need to handle scope. This means that the caller can decide whether to use transactions or not, depending on the business logic and performance requirements. Salesforce
Reference:B2B Commerce Developer Guide: Global APIs,B2B Commerce Developer Guide: Global API Versioning
Question 95

Which two statements are true regarding the cc_CallContext class in Salesforce B2B Commerce? (2 answers)
Explanation:
The cc_CallContext class is a utility class that provides access to various context level parameters, such as the current storefront, user, cart, price list, currency, locale, and session. The class can be used internally within Salesforce B2B Commerce and in subscriber code to access these parameters. The current storefront is accessible via this class by using the getStorefront method, which returns a cc_Storefront__c object. The userLocale variable returns the current Locale for storefront, but it is not part of the cc_CallContext class. It is a global variable that can be accessed from any Visualforce page or component by using {!userLocale}. The Salesforce session is accessible via the getSession method, but it is not part of the cc_CallContext class either. It is a method of the cc_SessionUtil class, which is another utility class that provides methods for managing sessions. Salesforce
Reference: [B2B Commerce Developer Guide: cc_CallContext Class], [B2B Commerce Developer Guide: cc_SessionUtil Class]
Question 96

Which two steps are necessary to enable Salesforce B2B Commerce logging in the managed package?
Explanation:
To enable Salesforce B2B Commerce logging in the managed package, you need to do two steps. First, you need to save a value in the Logging Token input field in the Global Settings section of CC Admin. This value can be any string that you choose, such as ''debug''. Second, you need to ensure that the value saved in the Logging token field is appended to the ccLog query parameter in the URL of the storefront page that you want to debug. For example, if your logging token is ''debug'', then your URL should look like this: https://my-storefront.com/?ccLog=debug. This will enable logging for that page only. You do not need to turn on the checkbox ''Cloudcraze Logging'' in CC Admin, as this is an old setting that is no longer used. You also do not need to set a cookie with the Id of the user accessing the storefront in CC Admin, as this is not required for logging. Salesforce
Reference: [B2B Commerce Developer Guide: Logging]
Question 97

Which two usages of ccLog should be avoided in Salesforce B2B Commerce? (2 answers)
Explanation:
You should avoid using ccLog in two scenarios. First, you should avoid using ccLog with System.LoggingLevel.ERROR when passing in a method invocation as the third parameter, such as ccrz.ccLog.log(System.LoggingLevel.ERROR, 'D:something', myCallToGetMessage(pl) ). This is because if an exception occurs within the method invocation, it will not be caught by ccLog and will cause an unhandled exception on the page. Instead, you should use a try-catch block around the method invocation and log the exception separately. Second, you should avoid using ccLog with System.LoggingLevel.DEBUG when passing in a large collection or object as the third parameter, such as ccrz.ccLog.log(System.LoggingLevel.DEBUG, 'D:myOrderList', myOrderList), where myOrderList is a list of orders. This is because logging large objects can cause performance issues and consume a lot of heap space. Instead, you should use a loop to log only the relevant fields or properties of the object or collection. You can use ccLog with System.LoggingLevel.WARN when passing in a string as the third parameter, such as ccrz.ccLog.log(System.LoggingLevel.WARN, 'D:something', 'Something unexpected occurred: The data we were expecting for pl was not there,'). This is a valid use case for logging a warning message. You can also use ccLog with System.LoggingLevel.DEBUG when passing in a small object as the third parameter, such as ccrz.ccLog.log(System.LoggingLevel.DEBUG, 'D:myOrder', myOrder), where myOrder is an order object. This is acceptable as long as the object is not too large or complex. Salesforce
Reference: [B2B Commerce Developer Guide: Logging]
Question 98

Why is the use of a standard Visualforce control such as apex:form discouraged in Salesforce B2B Commerce page includes and subscriber pages?
Explanation:
The use of a standard Visualforce control such as apex:form is discouraged in Salesforce B2B Commerce page includes and subscriber pages because the CCRZ JavaScript object is not accessible within an apex:form control. The CCRZ JavaScript object is a global object that provides access to various B2B Commerce functions and properties, such as logging, utilities, events, and configuration. Using an apex:form control would prevent the developer from using the CCRZ JavaScript object and its features. Visualforce does not ''scope'' controls that are present on a page and scope of the control will be set to ''ccrz'', as this is not a valid statement. Apex:form does not render DOM components slowly, as this is not a performance issue. JavaScript events are supported within an apex:form control, as this is not a limitation. Salesforce
Reference: B2B Commerce Developer Guide: CCRZ JavaScript Object, B2B Commerce Developer Guide: Page Includes
Question 99

Witch static method invocation is used to initialize ccrz.cc_CallContext with information from ccrz.cc_RemoteActionContext and return an instance of ccrz.cc_RemoteActionResult in an apex @RemoteAction methos?
Explanation:
The static method invocation that is used to initialize ccrz.cc_CallContext with information from ccrz.cc_RemoteActionContext and return an instance of ccrz.cc_RemoteActionResult in an Apex @RemoteAction method is ccrz.cc_CallContext.initCallContext(ccrz.cc_RemoteActionContext). This method takes in a ccrz.cc_RemoteActionContext object as a parameter and returns a ccrz.cc_RemoteActionResult object. The ccrz.cc_RemoteActionContext object contains information about the current storefront, user, cart, price list, currency, locale, and session. The ccrz.cc_RemoteActionResult object contains information about the status, result, and errors of the remote action. The other methods are not valid or do not exist. Salesforce
Reference: B2B Commerce Developer Guide: cc_CallContext Class, B2B Commerce Developer Guide: cc_RemoteActionContext Class, B2B Commerce Developer Guide: cc_RemoteActionResult Class
Question 100

Which two scoped modules should a developer import in Lightning web components to check user permissions?
Explanation:
To check user permissions in Lightning web components, a developer should import two scoped modules: @salesforce/permission and @salesforce/customPermission. The @salesforce/permission module allows the developer to check if the user has access to a standard permission, such as View Setup or Modify All Data. The @salesforce/customPermission module allows the developer to check if the user has access to a custom permission, such as Enable Debug Mode or Manage Orders. The other modules do not exist or are not related to user permissions. Salesforce
Reference: Lightning Web Components Developer Guide: Check User Permissions, Lightning Web Components Developer Guide: Import Salesforce Modules
Question