Which two methods from the platformResourceLoader module are relevant for including third party JavaScript and CSS in a Lightning web component?
Correct Answer: B,D
Two methods from the platformResourceLoader module that are relevant for including third party JavaScript and CSS in a Lightning web component are loadScript and loadStyle. The platformResourceLoader module is a module that provides methods for loading JavaScript or CSS files from static resources or external URLs into a Lightning web component. The loadScript method is used to load a JavaScript file and execute it in the component. The loadStyle method is used to load a CSS file and apply it to the component. The loadClientScript method does not exist or is not relevant for including third party JavaScript in a Lightning web component. The loadCss method does not exist or is not relevant for including third party CSS in a Lightning web component. Salesforce Lightning Web Components Developer Guide: Load Scripts and Style Sheets, [Lightning Web Components Developer Guide: platformResourceLoader Module]
Question 32
A developer has created a custom Lightning web component for the Cart page that needs to react to changes to cart items from the standard cart component. How should the developer implement the custom component so changes to cart items and quantities are reflected?
Correct Answer: A
The developer should implement the custom component so that it subscribes to events on the lightning_commerce_cartChanged channel using the Lightning Message Service. This is the recommended way to communicate between custom and standard components on the Cart page, as it allows the custom component to receive updates from the standard cart component whenever the cart items or quantities change. The Lightning Message Service is a pub/sub mechanism that enables components to communicate across the DOM, regardless of their namespace, technology, or source. The lightning_commerce_cartChanged channel is a predefined channel that carries information about the cart state, such as the cart ID, the cart items, and the cart total.Custom Component APIs,Lightning Message Service,Communicate Across the DOM with Lightning Message Service Learn more 1developer.salesforce.com2developer.salesforce.com
Question 33
What are two common and maintainable ways the content layout of a Lightning Web Component can be implemented?
Correct Answer: B,D
For maintainable and scalable Lightning Web Component development, it's recommended to style components by targeting the :host pseudo-element in the component's CSS file and by applying Salesforce Lightning Design System (SLDS) classes to internal elements. These practices ensure consistent styling that aligns with Salesforce's design standards and provides a clear separation of concerns between component structure and styling.
Question 34
What target does a developer need to set in the js-meta.xml file when creating a custom LWC component for use in the Checkout Flow?
Correct Answer: C
When creating a custom Lightning Web Component (LWC) for use in the Checkout Flow, a developer must set the target in the js-meta.xml file to lwc__FlowComponent. This target specifies that the LWC is intended for use within the flow component framework, allowing it to be utilized specifically in the context of Salesforce Flows, including those used in the checkout process. Salesforce documentation on developing custom LWCs for various targets would detail this requirement, ensuring that developers understand how to correctly package and deploy their components for the intended use case.
Question 35
Universal Containers (UC) is ready to build a tax provider class using the interfaces available in the Buyer Experience SDK. When creating a tax provider, what are three things that a developer should consider first?
Correct Answer: A,B,D
When creating a tax provider, three things that a developer should consider first are: steps to complete in the tax service, how to handle results, and what to implement. Steps to complete in the tax service are the actions that the developer needs to perform to connect to and use the third-party tax service provider's API or service. These steps may include authentication, authorization, request formatting, response parsing, error handling, and logging. How to handle results are the actions that the developer needs to perform to process and apply the tax calculation results from the tax service to the cart or order. These actions may include creating or updating cart items with type of Charge and charge type of Tax, applying tax adjustments or exemptions, and displaying tax amounts and details on the storefront. What to implement are the methods that the developer needs to define in their custom Apex class that implements the sfdc_checkout.TaxCalculations interface. The interface provides methods for customizing the tax calculation logic for a cart or an order, such as getTaxRatesAndRules, applyTaxAmountsAndAdjustments, and handleTaxErrorsAndExceptions. Whether to use JSON or XML is not something that the developer should consider first, as it is not a critical or relevant factor for creating a tax provider. It may depend on the format that the tax service provider supports or prefers, but it does not affect the overall functionality or performance of the tax integration. What events to fire in the Lightning web component is not something that the developer should consider first either, as it is not related to creating a tax provider. It may be an optional feature that the developer can add to enhance the user interface or user experience of their storefront, but it does not affect the core logic or functionality of the tax integration. Salesforce B2B Commerce Developer Guide: Tax Integration, [B2B Commerce Developer Guide: Tax Calculations Interface]