Which two technologies can subscribe to the CommerceDiagnosticEvents event?
A developer is working on a storefront that needs to use a sophisticated pricing engine hosted as a service outside the org. Assuming security and trusts have been established, which two actions must the developer take?
To use a sophisticated pricing engine hosted as a service outside the org, the developer must take the following actions:
Make a call to the service. The developer must use an Apex class or a Lightning web component to make a callout to the external service using the appropriate protocol, method, headers, parameters, and body. The developer must also handle the response from the service and parse the data as needed. The developer must ensure that the external service is added to the Remote Site Settings in Salesforce to allow the callout.
Implement the sfdc_checkout.PriceCalculations interface. The developer must implement this interface in an Apex class to override the default pricing logic of B2B Commerce and use the custom pricing logic from the external service. The developer must implement the methods of this interface, such as calculateCartPrice, calculateLineItemPrice, calculateShippingPrice, and so on. The developer must also register the custom pricing class in CC Admin under Storefront > Pricing > Pricing Engine.Reference:
Callouts from Lightning Web Components
Create a Custom Pricing Engine
While in the process of gathering requirements from a customer about how they would like to set up their net new storefront checkout experience, a consultant learns that the customer needs the ability to add new
shipping and billing addresses during checkout.
Which approach should a developer take to meet this requirement?
To enable buyers to add new shipping and billing addresses during checkout, a developer should take the following approach:
A developer is working on an existing checkout information built against the Lightning Web Runtime (LWR) and wants to implement a custom child checkout component to modify out-of-the-box functionality.
Which interface must the developer implement for the child component?
To implement a custom child checkout component to modify out-of-the-box functionality in an LWR checkout flow, the developer must implement the CheckoutStep interface. This interface defines the contract between the child component and the parent Checkout component, and allows the child component to communicate with the checkout flow. The developer must implement the methods of this interface, such as getStepName, getStepLabel, getStepStatus, validateStep, and so on. The developer can also use the @wire(CheckoutApi) decorator to access the checkout API methods and data.Reference:
Customize Your Checkout Flow for a B2B Store (LWR)
Which two are considered discrete units of work (code units) within a transaction in the debug logs?
Discrete units of work (code units) are blocks of code that execute as a single operation and can be rolled back if an error occurs. Within a transaction in the debug logs, the following are considered discrete units of work:
Web service invocation. This is a code unit that calls an external web service using SOAP or REST protocols. The web service invocation can be synchronous or asynchronous, and it can return a response or a fault. The debug logs show the request and response details, as well as the execution time and heap size of the code unit.
Apex class. This is a code unit that defines a custom class with variables, methods, constructors, and other elements. The Apex class can be invoked by triggers, Visualforce pages, Lightning components, or other classes. The debug logs show the entry and exit points, as well as the execution time and heap size of the code unit.Reference:
Execution Governors and Limits
Debug Log Analysis
Submit Cancel
Currently there are no comments in this discussion, be the first to comment!