ExamGecko
Home Home / Salesforce / Certified B2B Commerce Developer

Salesforce Certified B2B Commerce Developer Practice Test - Questions Answers, Page 12

Question list
Search
Search

List of questions

Search

How can a developer introduce new screen behavior in a checkout flow step?

A.
Modify the property mappings in checkoutSteps.xml
A.
Modify the property mappings in checkoutSteps.xml
Answers
B.
Edit the default subflow directly
B.
Edit the default subflow directly
Answers
C.
Clone the appropriate subflow and replace the Lightning web components in it
C.
Clone the appropriate subflow and replace the Lightning web components in it
Answers
D.
Adjust next-state in previous subflow configuration
D.
Adjust next-state in previous subflow configuration
Answers
Suggested answer: C

Explanation:

To introduce new screen behavior in a checkout flow step, a developer should clone the appropriate subflow and replace the Lightning web components in it. A subflow is a reusable flow that can be invoked from another flow as an element. A checkout flow is a flow that defines the steps and components for the checkout process in the storefront. A checkout flow consists of several subflows, each of which corresponds to a checkout step, such as Cart, Shipping Address, Payment, or Order Summary. To introduce new screen behavior in a checkout flow step, a developer should clone the subflow that matches the checkout step they want to modify and replace the Lightning web components in the cloned subflow with their custom components. The developer can then update the checkoutSteps.xml file to point to the cloned subflow instead of the original subflow. Modifying the property mappings in checkoutSteps.xml is not a valid way to introduce new screen behavior in a checkout flow step, as it only affects how data is passed between subflows, not how screens are displayed or rendered. Editing the default subflow directly is not a valid way either, as it can cause conflicts or errors with other stores or environments that use the same default subflow. Adjusting next-state in previous subflow configuration is not a valid way either, as it only affects how subflows are transitioned or navigated, not how screens are displayed or rendered. Salesforce

Reference: B2B Commerce Developer Guide: Checkout Flow, B2B Commerce Developer Guide: Checkout Subflows, B2B Commerce Developer Guide: Customize Checkout Steps

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?

A.
Create a custom Lightning web component that can be used with the standard payment component. Use a publish-<g, subscribe (pub-sub) model to listen to events from the standard component to determine which additional payment options should be shown.
A.
Create a custom Lightning web component that can be used with the standard payment component. Use a publish-<g, subscribe (pub-sub) model to listen to events from the standard component to determine which additional payment options should be shown.
Answers
B.
Create a custom Lightning web component for the checkout flow that has all the options available. Within that component, pull data from the account to determine which options to show.
B.
Create a custom Lightning web component for the checkout flow that has all the options available. Within that component, pull data from the account to determine which options to show.
Answers
C.
Modify the standard payment component settings in the checkout screen flow and add the new payment method. Use the component visibility feature in screen flows to fulfill the account-based payment option criteria.
C.
Modify the standard payment component settings in the checkout screen flow and add the new payment method. Use the component visibility feature in screen flows to fulfill the account-based payment option criteria.
Answers
D.
Add a new payment gateway through the reference implementation steps so the payment shows up on the checkout payment screen. Configure the different payment options required.
D.
Add a new payment gateway through the reference implementation steps so the payment shows up on the checkout payment screen. Configure the different payment options required.
Answers
Suggested answer: B

Explanation:

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, pull data 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

Reference: B2B Commerce Developer Guide: Payment Integration, B2B Commerce Developer Guide: Payment Component, B2B Commerce Developer Guide: Checkout Subflow

How should data for Lightning web components be provided?

A.
A few properties that contain sets (objects) of data
A.
A few properties that contain sets (objects) of data
Answers
B.
One property that contains all data in one set (object)
B.
One property that contains all data in one set (object)
Answers
C.
A single property object that contains sets (objects) of data
C.
A single property object that contains sets (objects) of data
Answers
D.
Independent properties that take simpler, primitive values (e.g. String, Number, Boolean, Array)
D.
Independent properties that take simpler, primitive values (e.g. String, Number, Boolean, Array)
Answers
Suggested answer: D

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

Reference: Lightning Web Components Developer Guide: Communicate with Properties, Lightning Web Components Developer Guide: Data Types

A developer needs to loop through a series of child components which are tiles. What is the correct syntax for this if the child component is called appTile?

A)

B)

C)

D)

A.
Option A
A.
Option A
Answers
B.
Option B
B.
Option B
Answers
C.
Option C
C.
Option C
Answers
D.
Option D
D.
Option D
Answers
Suggested answer: A

Explanation:

The correct syntax for looping through a series of child components which are tiles is option A. Option A uses the for:each directive to iterate over a collection of items and render a template block for each item. The for:each directive requires an expression that evaluates to an array or an iterable object and an item alias that represents the current item in the iteration. The item alias can be used to access the item's properties or pass them to child components. In option A, the expression is appTiles, which is an array of objects that represent app tiles, and the item alias is appTile, which represents the current app tile object in the iteration. The appTile object's properties, such as name, description, and icon, are passed to the app-tile child component using attributes. Option B is incorrect because it uses an invalid syntax for the for:each directive. The for:each directive requires a colon (:) after the for keyword, not an equal sign (=). Option C is incorrect because it uses an invalid syntax for the for:each directive. The for:each directive requires an item alias that represents the current item in the iteration, not a key alias that represents the current index in the iteration. Option D is incorrect because it uses an invalid syntax for the template tag. The template tag requires a closing tag (</template>), not a self-closing tag (<template/>). Salesforce

Reference: Lightning Web Components Developer Guide: Iterate Over a Collection, Lightning Web Components Developer Guide: Template Syntax

A developer needs to implement specific styling for a standard component on a single page of the B2B Commerce store using an Aura template. The component should use the default style on all other pages

How should the developer implement the required changes over multiple instances?

A.
Use a Custom CSS file in a static resource and add the import using the Edit Head Markup Editor in the Experience Builder.
A.
Use a Custom CSS file in a static resource and add the import using the Edit Head Markup Editor in the Experience Builder.
Answers
B.
Create a Custom Content Layout Lightning web component that imports the custom CSS file. Set up the page to use this Content Layout.
B.
Create a Custom Content Layout Lightning web component that imports the custom CSS file. Set up the page to use this Content Layout.
Answers
C.
Create a Custom Theme Layout Aura component that imports the custom CSS file. Set up the page to use this Theme Layout.
C.
Create a Custom Theme Layout Aura component that imports the custom CSS file. Set up the page to use this Theme Layout.
Answers
D.
Use the Override CSR Editor in the Experience Builder and add the desired CSS to change the styles.
D.
Use the Override CSR Editor in the Experience Builder and add the desired CSS to change the styles.
Answers
Suggested answer: C

Explanation:

To implement specific styling for a standard component on a single page of the B2B Commerce store using an Aura template, a developer should create a custom theme layout Aura component that imports the custom CSS file and set up the page to use this theme layout. A theme layout is a type of Aura component that defines the header and footer of a page in the storefront. A theme layout can also import custom CSS files from static resources and apply them to the page. A developer can create a custom theme layout Aura component that imports the custom CSS file that contains the specific styling for the standard component and assign it to the page that needs the custom styling. This way, the custom styling will only affect the standard component on that page and not on other pages that use a different theme layout. Using a custom CSS file in a static resource and adding the import using the Edit Head Markup Editor in the Experience Builder is not a valid way to implement specific styling for a standard component on a single page, as it will affect all pages that use the same template. Creating a custom content layout Lightning web component that imports the custom CSS file and setting up the page to use this content layout is not a valid way either, as it will not affect the standard component that is outside of the content layout. Using the Override CSR Editor in the Experience Builder and adding the desired CSS to change the styles is not a valid way either, as it will affect all pages that use the same template. Salesforce

Reference:B2B Commerce Developer Guide: Theme Layout Component,B2B Commerce Developer Guide: Content Layout Component,B2B Commerce Developer Guide: Override CSR Editor

Which two methods from the platformResourceLoader module are relevant for including third party JavaScript and CSS in a Lightning web component?

A.
loadClientScript
A.
loadClientScript
Answers
B.
loadScript
B.
loadScript
Answers
C.
loadCss
C.
loadCss
Answers
D.
loadStyle
D.
loadStyle
Answers
Suggested answer: B, D

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

Reference:Lightning Web Components Developer Guide: Load Scripts and Style Sheets, [Lightning Web Components Developer Guide: platformResourceLoader Module]

In which two ways can events fired from Lightning web components be handled?

A.
Programmatically adding event listeners
A.
Programmatically adding event listeners
Answers
B.
Adding callbacks to components
B.
Adding callbacks to components
Answers
C.
Listening for all possible events at the document root
C.
Listening for all possible events at the document root
Answers
D.
Attaching handlers to DOM elements
D.
Attaching handlers to DOM elements
Answers
Suggested answer: A, D

Explanation:

Two ways that events fired from Lightning web components can be handled are programmatically adding event listeners and attaching handlers to DOM elements. Programmatically adding event listeners is a way of handling events by using JavaScript code to register functions that are invoked when an event occurs. The developer can use methods such as addEventListener or @wire to add event listeners to components or services that fire events. Attaching handlers to DOM elements is a way of handling events by using HTML attributes to bind functions that are invoked when an event occurs. The developer can use attributes such as onclick or onchange to attach handlers to DOM elements that fire events. Adding callbacks to components is not a valid way of handling events fired from Lightning web components, as it is not related to event handling, but rather to asynchronous programming. Listening for all possible events at the document root is not a valid way either, as it is not efficient or recommended for event handling, as it can cause performance issues or conflicts with other event listeners. Salesforce

Reference: [Lightning Web Components Developer Guide: Handle Events], [Lightning Web Components Developer Guide: Communicate with Events]

Which two components in a B2B store template should a developer use to customize a storefront page?

A.
My Lists
A.
My Lists
Answers
B.
Product List
B.
Product List
Answers
C.
Order List
C.
Order List
Answers
D.
Address List
D.
Address List
Answers
Suggested answer: A, B

Explanation:

Two components in a B2B store template that a developer can use to customize a storefront page are My Lists and Product List. My Lists is a standard component that displays and manages lists of products that customers can create, save, or share in the storefront. A developer can use this component to enable customers to organize their favorite or frequently purchased products into lists and access them easily. Product List is a standard component that displays and filters products from one or more product lists in the storefront. A developer can use this component to showcase products from different categories or collections and allow customers to browse or search for products based on various criteria. Order List is not a component in a B2B store template, but rather an object that stores information about orders placed by customers in the storefront. Address List is not a component either, but rather an object that stores information about addresses associated with customers in the storefront. Salesforce

Reference: [B2B Commerce Developer Guide: My Lists Component], [B2B Commerce Developer Guide: Product List Component], [B2B Commerce Developer Guide: Order List Object], [B2B Commerce Developer Guide: Address List Object]

A developer has made a component with a lightning combobox in the follow! markup. To handle changes on the combobox, what should replace <CHANGE FVENT>?

A.
{event:handleChange}
A.
{event:handleChange}
Answers
B.
javascript:void(0);handleChange();
B.
javascript:void(0);handleChange();
Answers
C.
{handleChange()}
C.
{handleChange()}
Answers
D.
{handleChange}
D.
{handleChange}
Answers
Suggested answer: D

Explanation:

To handle changes on the combobox, the developer should replace <CHANGE EVENT> with {handleChange}. The handleChange is a function that is defined in the JavaScript file of the Lightning web component and is invoked when the value of the combobox changes. The developer can use this function to perform custom logic or actions based on the selected value of the combobox, such as updating other components or properties, calling Apex methods or services, or firing events. The developer can use the onchange attribute to bind the handleChange function to the combobox element in the HTML file of the Lightning web component. The onchange attribute is an HTML attribute that specifies a function to be executed when the value of an element changes. {event:handleChange} is not a valid way to handle changes on the combobox, as it is not a valid syntax for binding a function to an element. javascript:void(0);handleChange(); is not a valid way either, as it is not a valid syntax for binding a function to an element. {handleChange()} is not a valid way either, as it is not a valid syntax for binding a function to an element. Salesforce

Reference: Lightning Web Components Developer Guide: Handle Events, Lightning Web Components Developer Guide: Communicate with Properties, Lightning Web Components Developer Guide: lightning-combobox

A developer is working in Visual Studio Code on a previously deployed project which is rather large and deployments are time consuming. The developer wants to deploy some small CSS changes without waiting for the entire project deployment. What are two ways this can be accomplished?

A.
Right-click the folder for the component and choose Deploy Source to Org
A.
Right-click the folder for the component and choose Deploy Source to Org
Answers
B.
Right-click the CSS file that was edited and select Deploy Single File
B.
Right-click the CSS file that was edited and select Deploy Single File
Answers
C.
Right-click the CSS file and choose Deploy Source to Org
C.
Right-click the CSS file and choose Deploy Source to Org
Answers
D.
Click the Tools menu and select Deploy styles
D.
Click the Tools menu and select Deploy styles
Answers
E.
Deploy the entire project. Only the change will be copied
E.
Deploy the entire project. Only the change will be copied
Answers
Suggested answer: A, B

Explanation:

Two ways that a developer can deploy some small CSS changes without waiting for the entire project deployment are right-clicking the folder for the component and choosing Deploy Source to Org and right-clicking the CSS file that was edited and selecting Deploy Single File. Deploying source to org is a way of deploying metadata from a local project to an org using Salesforce CLI commands. The developer can use Visual Studio Code to execute these commands by right-clicking on files or folders in the project and choosing from various deployment options. Right-clicking the folder for the component and choosing Deploy Source to Org allows the developer to deploy only the files that belong to that component, such as HTML, JavaScript, CSS, and XML files. Right-clicking the CSS file that was edited and selecting Deploy Single File allows the developer to deploy only that CSS file and not any other files in the project. These options can save time and bandwidth for deploying small changes without affecting other components or files in the project. Modifying the StoreIntegratedService to map to an Apex class ID using Workbench is not a way of deploying CSS changes, as it is only used for registering internal services that are provided by Salesforce B2B Commerce out-of-the-box. Entering the integration class name and version in store administration is not a way of deploying CSS changes either, as it is only used for selecting an existing integration class that has already been registered as an external service. Salesforce

Reference: Salesforce CLI Command Reference: force:source:deploy, Salesforce Developer Tools for Visual Studio Code, B2B Commerce Developer Guide: Integration Framework, B2B Commerce Developer Guide: RegisteredExternalService Object

Total 221 questions
Go to page: of 23