ExamGecko
Home Home / Salesforce / Certified B2B Commerce Administrator

Salesforce Certified B2B Commerce Administrator Practice Test - Questions Answers, Page 22

Question list
Search
Search

Which tool should a developer use to author automated tests for custom Lightning web components?

A.
Visual Studio Code
A.
Visual Studio Code
Answers
B.
Salesforce CLI
B.
Salesforce CLI
Answers
C.
Jest
C.
Jest
Answers
D.
Salesforce Developer Console
D.
Salesforce Developer Console
Answers
Suggested answer: C

Explanation:

The tool that a developer should use to author automated tests for custom Lightning web components is Jest.Jest is a JavaScript testing framework that provides features such as mocking, code coverage, snapshots, and asynchronous testing6.Jest is integrated with Salesforce CLI and Visual Studio Code, which makes it easy to create, run, and debug tests for Lightning web components7.Jest tests are written in local JavaScript files that are committed to version control along with the component itself8.Jest tests can verify the functionality, performance, accessibility, and user interface of Lightning web components9.Reference:Jest,Test Lightning Web Components,Write Jest Tests,Testing Strategies

Which option is the correct syntax to render a property in a Lightning web component template?

A.
Surround the property with curly braces: {property}
A.
Surround the property with curly braces: {property}
Answers
B.
Surround the property with brackets: [property]
B.
Surround the property with brackets: [property]
Answers
C.
Surround the property with an exclamation point and curly braces: {property}
C.
Surround the property with an exclamation point and curly braces: {property}
Answers
D.
Surround the property with curly braces and exclamation point: {{property}
D.
Surround the property with curly braces and exclamation point: {{property}
Answers
Suggested answer: A

Explanation:

Surround the property with curly braces: {property} because this is the syntax for data binding in a Lightning web component template. Data binding is a way to link a property in a component's template to a property in the component's JavaScript class.When the value of the property changes, the component re-renders and updates the template accordingly1. For example, suppose there is a component that has a name property in its JavaScript class:

// helloWorld.js import { LightningElement, api } from 'lwc';

export default class HelloWorld extends LightningElement { // Declare a public name property @api name = 'World'; }

To render the name property in the component's template, surround it with curly braces:

<!-- helloWorld.html --> <template>

Hello, {name}! </template>

The output will look like this:

Hello, World!

What is the fastest route to setting up a B2B Commerce Store as a developer?

A.
Create a new store in the Commerce app
A.
Create a new store in the Commerce app
Answers
B.
Use sfdx setup scripts
B.
Use sfdx setup scripts
Answers
C.
Import a previously exported store archive
C.
Import a previously exported store archive
Answers
D.
Set up B2B Commerce on Lightning Experience manually
D.
Set up B2B Commerce on Lightning Experience manually
Answers
Suggested answer: B

Explanation:

The fastest route to setting up a B2B Commerce Store as a developer is to use sfdx setup scripts.Sfdx is a command-line tool that allows developers to create, manage, and deploy Salesforce applications using source-driven development2.Sfdx setup scripts are preconfigured commands that automate the process of creating and configuring a B2B Commerce Store in a scratch org3.A scratch org is a temporary Salesforce org that can be used for development and testing purposes4. Using sfdx setup scripts, a developer can quickly set up a B2B Commerce Store with sample data and customizations, without having to manually create a store in the Commerce app or import a previously exported store archive.The developer can also use sfdx commands to push and pull source code changes between the scratch org and the local project folder5.To use sfdx setup scripts, the developer needs to install Salesforce CLI, Visual Studio Code, and Git on their machine, and clone the B2B Commerce on Lightning Experience repository from GitHub6.Then, the developer can run the setup scripts from the command line or from Visual Studio Code7.Reference:Salesforce CLI,SFDX Setup Scripts,Scratch Orgs,Source-Driven Development,Set Up Your Development Environment,Create Your First Store

How can a developer bring in a checkout flow step to another sequence order? 02m 06s

A.
Reorder step in checkoutSteps.xml
A.
Reorder step in checkoutSteps.xml
Answers
B.
drag and drop subflows in main checkout flow
B.
drag and drop subflows in main checkout flow
Answers
C.
drag and drop checkout Screens in main checkout flow
C.
drag and drop checkout Screens in main checkout flow
Answers
D.
Adjust next-state in previous subflow configuration
D.
Adjust next-state in previous subflow configuration
Answers
Suggested answer: D

Explanation:

Adjust next-state in previous subflow configuration because this is the way to bring in a checkout flow step to another sequence order. A checkout flow step is a subflow that represents a stage in the checkout process, such as shipping, payment, or review.A subflow is a reusable unit of logic that can be invoked from another flow1. To change the order of the checkout flow steps, a developer needs to modify the next-state attribute of the previous subflow configuration.The next-state attribute specifies the name of the next subflow to execute after the current one finishes2. For example, suppose there are three checkout flow steps: shipping, payment, and review. To bring in the payment step before the shipping step, the developer needs to adjust the next-state attribute of the start subflow configuration to point to the payment subflow instead of the shipping subflow:

<!-- start.subflow --> <subflow name=''start''> <subflow-state id=''start'' subflow=''start''> <next-state on=''success'' value=''payment''/> <!-- Change this from shipping to payment --> </subflow-state> </subflow>

What is the fastest route to establishing the data needed for checkout development when setting up a new Store?

A.
Import a previously exported store archive
A.
Import a previously exported store archive
Answers
B.
Use sfdx setup scripts
B.
Use sfdx setup scripts
Answers
C.
Select Add Sample Data when setting up the store
C.
Select Add Sample Data when setting up the store
Answers
D.
Import the data with data loader
D.
Import the data with data loader
Answers
Suggested answer: B

Explanation:

The fastest route to establishing the data needed for checkout development when setting up a new store is to use sfdx setup scripts.Sfdx is a command-line tool that allows developers to create, manage, and deploy Salesforce applications using source-driven development3.Sfdx setup scripts are preconfigured commands that automate the process of creating and configuring a B2B Commerce Store in a scratch org4.A scratch org is a temporary Salesforce org that can be used for development and testing purposes5. Using sfdx setup scripts, a developer can quickly set up a B2B Commerce Store with sample data and customizations, without having to manually create a store in the Commerce app or import a previously exported store archive.The developer can also use sfdx commands to push and pull source code changes between the scratch org and the local project folder6.To use sfdx setup scripts, the developer needs to install Salesforce CLI, Visual Studio Code, and Git on their machine, and clone the B2B Commerce on Lightning Experience repository from GitHub7.Then, the developer can run the setup scripts from the command line or from Visual Studio Code8.Reference:Salesforce CLI,SFDX Setup Scripts,Scratch Orgs,Source-Driven Development,Set Up Your Development Environment,Create Your First Store

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.
Adjust next-state in previous subflow configuration
C.
Adjust next-state in previous subflow configuration
Answers
D.
Clone the appropriate subflow and replace the Lightning web components in it
D.
Clone the appropriate subflow and replace the Lightning web components in it
Answers
Suggested answer: D

Explanation:

To introduce new screen behavior in a checkout flow step, the developer should clone the appropriate subflow and replace the Lightning web components in it. This way, the developer can customize the layout, logic, and functionality of the checkout step without modifying the default subflow. The developer can also use the component visibility feature in screen flows to show or hide components based on conditions.Reference:

Customize Your Checkout Flow for a B2B Store (Aura)

Build a Checkout Flow for a B2B Store (Aura)

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. ---------

m Ss

* 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-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-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.
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.
C.
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
D.
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
D.
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
Answers
Suggested answer: B

Explanation:

To update the checkout process with different payment types, the developer should create a custom Lightning web component for the checkout flow that has all the options available. Within that component, the developer can pull data from the account to determine which options to show based on the custom checkbox field. This approach allows the developer to have full control over the payment logic and UI, and avoid using multiple components or events.Reference:

Checkout Flow Component (Aura) for B2B Stores

Lightning Web Components Developer Guide

What tool can a developer use to investigate errors during development? 01m 29s

A.
Commerce Diagnostics Event Logging
A.
Commerce Diagnostics Event Logging
Answers
B.
Checkout Flow Log
B.
Checkout Flow Log
Answers
C.
Support cases
C.
Support cases
Answers
D.
Browser dev tools
D.
Browser dev tools
Answers
Suggested answer: A

Explanation:

Commerce Diagnostics Event Logging is a tool that allows developers to view and analyze the events that occur during the execution of a Commerce request. It can help identify errors, performance issues, and potential optimizations in the code.Commerce Diagnostics Event Logging can be enabled or disabled in the Commerce Settings page in Setup1.Reference:1: Configure Your B2B and B2B2C Commerce Store - Trailhead2

Which two event settings are required for a custom event called CustomEvent to fire from the Lightning web component and propagate up to the DOM?

A.
bubbles: true
A.
bubbles: true
Answers
B.
composed: true
B.
composed: true
Answers
C.
cancelable: true
C.
cancelable: true
Answers
D.
composed: false
D.
composed: false
Answers
Suggested answer: A, B

Explanation:

To fire a custom event from a Lightning web component and propagate it up to the DOM, the event must have the bubbles and composed properties set to true. The bubbles property indicates whether the event should bubble up through the component hierarchy or not. The composed property indicates whether the event should cross the shadow boundary and reach the DOM.If either of these properties is false, the event will not be visible to the DOM elements3.Reference:3: Communicate with Events - Trailhead4

How can a developer establish communication between components that are not in the same (Document Object Model) tree?

A.
Use publish-subscribe pattern.
A.
Use publish-subscribe pattern.
Answers
B.
Configure targets property.
B.
Configure targets property.
Answers
C.
Use dispatch events.
C.
Use dispatch events.
Answers
D.
Use @api decorators.
D.
Use @api decorators.
Answers
Suggested answer: A

Explanation:

To establish communication between components that are not in the same DOM tree, the developer should use the publish-subscribe pattern. This pattern allows components to communicate across the DOM tree without depending on their position in the hierarchy. The developer can use the Lightning Message Service (LMS) to implement this pattern, which provides a standard and secure way to exchange messages across different components and namespaces.Reference:

Communicate Across the DOM

Lightning Message Service Basics

Total 256 questions
Go to page: of 26