How should data for Lightning web components be provided?
A. A few properties that contain sets (objects) of data
B. One property that contains all data in one set (object)
C. A single property object that contains sets (objects) of data
D. Independent properties that take simpler, primitive values (e.g. String, Number, Boolean, Array)
Explanation:
Data for Lightning web components should be provided as independent
properties that take simpler, primitive values (e.g. String, Number, Boolean, Array).
Providing data as independent properties allows the developer to expose data as public or
private properties of the Lightning web component and communicate data between
components or services. Providing data as simpler, primitive values allows the developer to
use data types that are supported by JavaScript and Lightning web components and avoid
unnecessary or complex conversions or transformations. Providing data as a few
properties that contain sets (objects) of data is not a good way to provide data for Lightning
web components, as it can create confusion or inconsistency in data structure and access.
Providing data as one property that contains all data in one set (object) is not a good way
either, as it can create complexity or inefficiency in data management and manipulation.
Providing data as a single property object that contains sets (objects) of data is not a good
way either, as it can create redundancy or duplication in data storage and retrieval.
Salesforce References: Lightning Web Components Developer Guide: Communicate with
Properties, Lightning Web Components Developer Guide: Data Types
An administrator has just provided a developer with a new org and username. Which two sets of steps can the developer use to authorize the org and begin deploying Lightning web components? What should a developer do to expose a public property in a Lightning web component?
A. Decorate the field with @property
B. Decorate the field with @track
C. Decorate the field with @public
D. Decorate the field with @api
Explanation:
To expose a public property in a Lightning web component, the developer should decorate
the field with the @api decorator. This decorator marks the property as public, which
means that it can be set by another component, such as a parent component. The @api
decorator also makes the property reactive, which means that any changes to the property
value are reflected in the component’s template. The other decorators (@property, @track,
and @public) are not valid for exposing public properties in Lightning web
components. References: B2B Commerce and D2C Commerce Developer Guide,
[Lightning Web Components Developer Guide]
How should a developer get the grand total amount, including shipping and tax, for items in the cart and in the currency of the cart, when developing a new Lightning web component for an Aura storefront cart page?
A. {!Cart.Details.grandTotal}
B. {ICart.Totals.grand Total}
C. {ICart.Details.Fields.grandTotal}
D. {!Cart.Fields.grandTotal}
Explanation:
According to the B2B Commerce Developer Guide, the ICart interface
provides access to the cart object and its related data. The Details property of the ICart
interface returns an ICartDetails object, which contains information about the cart such as
the currency, the subtotal, the shipping cost, the tax, and the grand total. The Fields
property of the ICartDetails interface returns a map of field names and values for the cart
object. Therefore, to get the grand total amount for items in the cart and in the currency of
the cart, a developer should use the expression {ICart.Details.Fields.grandTotal}, which
returns the value of the grandTotal field from the cart object. References: B2B Commerce
Developer Guide, ICart Interface, ICartDetails Interface
Which code statement should a developer use to import the ID of the current Lightning Experience
A. import id from '@salesforce/network/ld'
B. import id from '@salesforce/experience/ld'
C. import id from '@salesforce/site/ld'
D. import id from '@salesforce/community/ld'
Explanation:
To import the ID of the current Lightning Experience community, a developer
should use the following code statement:
import id from ‘@salesforce/community/Id’;
The @salesforce/community module allows the developer to access information about the
current community, such as its ID, name, URL, and base path. The other modules do not
exist or are not related to the community ID. The @salesforce/network module is used to
access information about the current network, such as its ID and name. The
@salesforce/experience module is used to access information about the current user
experience, such as whether it is standard or custom. The @salesforce/site module is used
to access information about the current site, such as its name and prefix.
Salesforce
References: [Lightning Web Components Developer Guide: Import Community
Information], [Lightning Web Components Developer Guide: Import Salesforce Modules]
Which three actions are applicable when modifying the number of steps required in the Salesforce Commerce Checkout flow? (3 answers)
A. Perform a template override on the Checkout page.
B. Add a page include to the checkout page.
C. Build and activate a new configuration cache setting via CC admin.
D. Set the value of the configuration setting defined as CO.useDef to TRUE
E. Set the value of the configuration setting defined as CO.overrideFlow to TRUE.
Explanation:
Three actions that are applicable when modifying the number of steps required in the
Salesforce Commerce Checkout flow are:
Perform a template override on the Checkout page. This action will allow you to
change the structure and content of the Checkout page, such as adding or
removing sections, widgets, or fields. For example, you can override the
checkout.handlebars template and modify it according to your requirements.
Set the value of the configuration setting defined as CO.overrideFlow to TRUE.
This setting will enable you to use your own custom checkout flow instead of the
default one. You need to set this value to true before you can modify the checkout
flow.
Set the value of the configuration setting defined as CO.useDef to TRUE. This
setting will enable you to use a single-page checkout flow instead of a multi-step
checkout flow. You need to set this value to true if you want to reduce the number
of steps in the checkout flow to one. Salesforce References: B2B Commerce and
D2C Commerce Developer Guide, Checkout Flow
Which two methods from the platformResourceLoader module are relevant for including third party JavaScript and CSS in a Lightning web component?
A. loadClientScript
B. loadScript
C. loadCss
D. loadStyle
Explanation:
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
References: Lightning Web Components Developer Guide: Load Scripts and Style Sheets,
[Lightning Web Components Developer Guide: platformResourceLoader Module]
Which component can be used in other Salesforce Experience templates outside of B2B Commerce?
A. Quick Order
B. CMS Collection
C. Product Detail Data
D. Results Layout
Explanation:
In Salesforce Experience Cloud, components like CMS Collection and
Results Layout are designed to be reusable across different Experience templates, not just
limited to B2B Commerce. CMS Collection allows for the display of CMS content in a
flexible and dynamic layout, while Results Layout can be used to present search or query
results in a customizable format. Salesforce documentation on Experience Cloud
components emphasizes the reusability and adaptability of these components across
various templates and contexts.
What class must a developer implement to override Pricing during the checkout?
A. sfdc_commerce.CartPriceCalculations
B. sfdc_commerce.PriceCalculations
C. sfdc_checkout.PriceCalculations
D. sfdc_checkout.CartPriceCalculations
Explanation:
To override pricing during the checkout process in Salesforce B2B
Commerce, a developer must implement a class specifically designed for this purpose,
such assfdc_checkout.CartPriceCalculations. This class would provide the necessary
framework for custom pricing logic to be applied during checkout, ensuring that any custom
pricing requirements are met.
When a developer configures a tax integration for a store, what happens to the previously calculated tax entries during the checkout flow?
A. Ignored during recalculation
B. Saved prior to recalculation
C. Deleted from the Cart
D. Modified with the new tax calculation
Explanation:
When a developer configures a tax integration for a store, the previously
calculated tax entries during the checkout flow are deleted from the Cart. A tax integration
is an integration that calculates and applies tax rates and amounts to a Cart or an Order
based on various factors, such as product type, price, quantity, location, and tax rules. A
tax integration can use either an external tax service provider or custom Apex code to
perform the tax calculation. When a developer configures a tax integration for a store, any
existing tax entries in the Cart are deleted before calling the tax integration service or
method. This ensures that the tax calculation is accurate and up-to-date based on the
current state of the Cart and avoids any conflicts or inconsistencies with previous tax
entries. The previously calculated tax entries are not ignored during recalculation, saved
prior to recalculation, or modified with the new tax calculation, as these are not valid
actions for handling existing tax entries. Salesforce References: B2B Commerce Developer
Guide: Tax Integration, B2B Commerce Developer Guide: Tax Calculation Flow
What is the purpose of connected Call back in a Lightning web component?
A. It performs actions when a network request is made.
B. It perform actions when a component makes a call to a Connect APL.
C. It performs actions when a component is removed from the DOM.
D. It performs actions when a component is added to the DOM.
Explanation:
The connectedCallback is a lifecycle hook that is invoked when a Lightning
web component is inserted into the DOM. It is used to perform any initialization tasks that
depend on the component being rendered, such as fetching data, setting up event
listeners, or creating timers. The connectedCallback can fire more than once, for example,
when a component is moved or rerendered. The connectedCallback should not be used to
change the state of a component, such as loading values or setting properties. Use getters
and setters instead. The other options are incorrect because they do not describe the
purpose of the connectedCallback.
References: Lifecycle Hooks | Lightning Web
Components Developer Guide, connectedCallback() in Lightning Web Component -
Salesforce Diaries, Chapter 23: connnectedCallback() in Lightning Web Component
Which of these is a key pattern leveraged when building Lightning Web Components? 39m 36s
A. Composition
B. Inventory
C. Juggling
D. Normalization
Explanation:
Composition is a key pattern in building Lightning Web Components (LWCs).
This approach involves creating small, reusable components that can be assembled to
form more complex interfaces. This pattern promotes modularity, reusability, and
maintainability in the development of web components, aligning with web standards and
best practices.
How can the display of CC Menu Items be customized for different users?
A. cc_hk_Category extension to pre-process which category items are cached as menu items
B. cc_hk_Menu extension to post-process any cached menu items
C. cc_hk_Menu extension to pre-process which menu items are cached
D. cc_hk_Category extension to post-process any cached menu items
Explanation:
The display of CC Menu Items can be customized for different users by using the
cc_hk_Menu extension to post-process any cached menu items. This extension allows
modifying the menu items based on the user context, such as the user role, account, or
cart. For example, the extension can hide or show certain menu items based on the user’s
permissions or preferences.
Page 3 out of 18 Pages |
Previous |