Salesforce B2B leverages global API's for encapsulating business logic into blocks that can be extended and modified by subscribers. Which three statements are true regarding extending ccServiceProduct and exposing custom fields on the Product Detail Page? (3 answers)
Correct Answer: A,C,E
Explanation To extend ccServiceProduct and expose custom fields on the Product Detail Page, three statements are true: * Override the getFieldsMap method and add subscriber specific code. This method returns a map of field names and field types for the product entity and its related entities. By overriding this method, the subscriber can add their custom fields to the map and make them available for the API. * Create a global with sharing class that extends ccrz.ccServiceProduct. This class will inherit all the methods and properties of the ccServiceProduct class and allow overriding or extending them. The class should be global and with sharing to ensure that it can be accessed by the API framework and respect the sharing rules. * Override the fetch method and add your subscriber specific code here. This method executes the query to fetch the product data and returns a result object. By overriding this method, the subscriber can modify the query or the result object to include their custom fields or logic. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Service Classes, ccServiceProduct Class
Question 2
While working on a commerce rollout, a developer needs to update the checkout process so that buyers can purchase with one of the below payment types. * Credit Card * Purchase Order * Contract Now & Pay Later Additionally, the developer needs to show only Purchase Order and Contract Now & Pay Later if a custom checkbox field on the account is checked. How should the developer meet these requirements?
Correct Answer: B
To update the checkout process so that buyers can purchase with one of the below payment types: * Credit Card * Purchase Order * Contract Now & Pay Later Additionally, show only Purchase Order and Contract Now & Pay Later if a custom checkbox field on the account is checked, a developer should create a custom Lightning web component for the checkout flow that has all the options available. Within that component, pulldata from the account to determine which options to show. Creating a custom Lightning web component for the checkout flow allows the developer to define custom logic and user interface for processing payments using different payment types. The developer can use Apex methods or third-party APIs to integrate with payment service providers or payment gateways and handle payment authorization, capture, void, and refund. The developer can also use @wire or @api decorators to get data from the account object and use its properties, such as the custom checkbox field, to determine which payment options to show or hide based on business logic. Creating a custom Lightning web component that can be used with the standard payment component is not a valid way to meet this requirement, as it does not allow the developer to replace or modify the standard payment component's logic or user interface. Modifying the standard payment component settings in the checkout screen flow and adding the new payment method is not a valid way either, as it does not allow the developer to add custom payment types or conditional logic based on account data. Adding a new payment gateway through the reference implementation steps so the payment shows up on the checkout payment screen is not a valid way either, as it does not allow the developer to add multiple payment options or conditional logic based on account data. Salesforce References: B2B Commerce Developer Guide: Payment Integration, B2B Commerce Developer Guide: Payment Component, B2B Commerce Developer Guide: Checkout Subflow
Question 3
Which method signature is used in the Global API's?
Correct Answer: B
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 References: B2B Commerce and D2C Commerce Developer Guide, API Classes, cc_Input Class, cc_Output Class
Question 4
Which two usages of ccLog should be avoided in Salesforce B2B Commerce? (2 answers)
Correct Answer: A,C
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 5
A developer is writing custom code to compare External Prices and Sales Prices for cart items. What should be returned if the External Prices are the same as Sales Prices for Products in the Cart? ~.
Correct Answer: A
Similar to question 198, when custom code compares external prices with sales prices for cart items and finds them to be the same, the appropriate return value should indicate a successful comparison (such assfdc_checkout.IntegrationStatus.Status.SUCCESS). This signifies that the external prices are aligned with the sales prices, and there are no conflicts.