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?
A. ccrz.cc_CallContext.init(ccrz.cc_RemoteActionContext)
B. ccrz.cc_CallContext.initCallContext(ccrz.cc_RemoteActionContext)
C. ccrz.cc_CallContext.initRemoteActionContext(ccrz.cc_RemoteActionContext)
D. ccrz.cc_CallContext.initializeCallContext(ccrz.cc_RemoteActionContext)
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
A developer needs to implement a custom Lightning web component (LWC) for the storefront. The LWC contains language-specific text values. How should the developer translate the text values?
A. Import static resources for the text values and add them into the LWC
B. Use a CustomLabel xml file in the LWC to add the text values there.
C. Create custom labels for the text values and import them in the LWC.
D. Create a custom Metadata object for the text values and query it in the LWC.
Explanation:
Custom labels are text values that can be translated into any language that
Salesforce supports. They are useful for displaying language-specific text in Lightning web
components. To use custom labels in a LWC, the developer needs to create them in the
Setup menu and assign them to a language and a value. Then, the developer can import
them in the LWC using the @salesforce/label scoped module. For example, if the
developer has a custom label named welcomeHeader, they can import it as follows:
import welcomeHeader from '@salesforce/label/c.welcomeHeader';
Then, they can use it in the HTML template or the JavaScript file of the LWC. For example,
in the HTML template, they can use it as follows:
HTMLAI-generated code. Review and use carefully. More info on FAQ.
{welcomeHeader}
The custom label will automatically display the translated value based on the user’s
language preference. The developer can also use the lightning-formatted-text component
to format the custom label value with HTML tags.
The other options are not correct because:
A. Importing static resources for the text values is not a recommended way to
translate text values in a LWC. Static resources are files that are stored in
Salesforce and can be referenced by applications. They are not designed for
storing language-specific text values and they do not support automatic translation
based on the user’s language preference.
B. Using a CustomLabel xml file in the LWC to add the text values there is not a
valid option. Custom labels are not stored in xml files, but in the Setup menu. They
cannot be added directly to the LWC, but they need to be imported using
the @salesforce/label scoped module.
D. Creating a custom Metadata object for the text values and querying it in the
LWC is not a feasible option. Custom Metadata objects are records that store
configuration data that can be deployed and packaged. They are not intended for
storing language-specific text values and they do not support automatic translation
based on the user’s language preference. Querying them in the LWC would also
require an Apex class and a wire service, which would add unnecessary
complexity to the solution.
References:
Use Custom Labels in Lightning Web Components
Custom Labels
Internationalizing Your Lightning Web Component (LWC)
Which two user permissions in addition to View Setup and Configuration are required to Question No : 20 Salesforce B2B-Commerce-Developer : Practice Test 17 bulk create Product data translations via Data Loader?
A. Import Custom Objects
B. B2B Commerce Super User
C. Create and set up Experiences
D. Manage Translations
Explanation:
To bulk create product data translations via Data Loader, permissions
beyond View Setup and Configuration are necessary. "Import Custom Objects" permission
is required to import bulk data into Salesforce, including translations for custom objects.
"Manage Translations" permission is essential for managing translation workbench settings
and importing/exporting translation files, which is crucial for handling product data
translations.
A developer has the task to create custom Lightning web components (LWCs). Which two steps must a developer take when creating custom LWCs?
A. Create an Apex class
B. Authorize an org for an SFDX project.
C. CloneaLWC.
D. Deploy a custom component.
Explanation:
To create custom Lightning web components (LWCs), a developer must take
two steps: authorize an org for an SFDX project and deploy a custom component.
Authorizing an org for an SFDX project allows the developer to connect to a Salesforce org,
such as a scratch org, a sandbox, or a production org, and use it as a development
environment. Deploying a custom component allows the developer to push the LWC code
from the local project to the org and make it available for use. Creating an Apex class is not
a required step for creating custom LWCs, as not all LWCs need to use Apex. Cloning an
LWC is not a required stepeither, as it is an optional way to create a new LWC based on an
existing one. Salesforce References: Lightning Web Components Developer Guide:
Authorize an Org for Development, Lightning Web Components Developer Guide: Deploy
Your Component
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]
Page 3 out of 22 Pages |
Previous |