ExamGecko
Home Home / Salesforce / Certified B2B Commerce Developer

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

Question list
Search
Search

List of questions

Search

A developer is building a custom component in Lightning web components (LWC) that needs to fetch data from an API.

Which lifecycle hook should the developer use to make the API call?

A.
connectedCallback
A.
connectedCallback
Answers
B.
renderedCallback
B.
renderedCallback
Answers
C.
errorCallback
C.
errorCallback
Answers
D.
disconnectedCallback
D.
disconnectedCallback
Answers
Suggested answer: A

Explanation:

To make an API call in a Lightning web component (LWC), a developer should use the connectedCallback lifecycle hook. The connectedCallback lifecycle hook is invoked when the component is inserted into the DOM. This is the ideal time to make an API call, as the component is ready to receive and display data. The developer can use the fetch API or a third-party library, such as axios, to make the API call and handle the response. The renderedCallback lifecycle hook is not a good choice for making an API call, as it is invoked every time the component is rendered or rerendered. This can cause unnecessary or repeated API calls and affect performance. The errorCallback lifecycle hook is not a good choice either, as it is invoked when an error occurs in the component or in one of its children. This is not related to making an API call, but rather to handling errors. The disconnectedCallback lifecycle hook is not a good choice either, as it is invoked when the component is removed from the DOM. This is not a suitable time to make an API call, as the component is no longer visible or active. Salesforce

Reference:Lightning Web Components Developer Guide: Lifecycle Hooks,Lightning Web Components Developer Guide: Call an Apex Method Imperatively

A developer is creating a component to implement a custom Terms and Conditions checkbox at checkout in the Aura Commerce template.

Which method should the developer implement on the Lightning web component to ensure the user accepts the terms and conditions?

A.
ComponentValidity
A.
ComponentValidity
Answers
B.
Validate
B.
Validate
Answers
C.
SaveCheckout
C.
SaveCheckout
Answers
D.
CheckValidity
D.
CheckValidity
Answers
Suggested answer: B

Explanation:

To implement a custom Terms and Conditions checkbox at checkout in the Aura Commerce template, a developer should add a Desired Delivery Date input field during the checkout flow. The Desired Delivery Date input field allows the customer to enter a date when they want their order to be delivered. The developer can use the @api decorator to expose this field as a public property of the Lightning web component and bind it to the ccCheckoutOrder object. The developer can also use the @wire decorator to get the current cart object and use its properties, such as shipping address and shipping method, to calculate and display an estimated delivery date based on the desired delivery date. The developer can also add validation logic to ensure that the desired delivery date is valid and acceptable. Adding the Expected Delivery Date field to the order confirmation email is not a good solution, as it does not allow the customer to choose or see their delivery date before placing their order. Displaying the Expected Delivery Date on the order page with a Lightning web component is not a good solution either, as it does not allow the customer to enter or change their delivery date after placing their order. Configuring an email alert to the customer when the Expected Delivery Date changes is not a good solution either, as it does not provide a consistent or reliable way of informing the customer about their delivery date. Salesforce

Reference:B2B Commerce Developer Guide: Checkout Flow,B2B Commerce Developer Guide: Checkout Order Object,Lightning Web Components Developer Guide: Communicate with Properties

Northern Trail Outfitters (NTO) has a B2B Commerce store for its resellers. It has received many customer service calls involving questions about the delivery date of customer orders.

How should a developer expose delivery time estimates to NTO's customers in the storefront to reduce call volume?

A.
Add the Expected Delivery Date field to the order confirmation email.
A.
Add the Expected Delivery Date field to the order confirmation email.
Answers
B.
Add a Desired Delivery Date input field during the checkout flow.
B.
Add a Desired Delivery Date input field during the checkout flow.
Answers
C.
Display the Expected Delivery Date on the order page with a Lightning web component.
C.
Display the Expected Delivery Date on the order page with a Lightning web component.
Answers
D.
Configure an email alert to the customer when the Expected Delivery Date changes.
D.
Configure an email alert to the customer when the Expected Delivery Date changes.
Answers
Suggested answer: C

Explanation:

To expose delivery time estimates to NTO's customers in the storefront, a developer should display the Expected Delivery Date on the order page with a Lightning web component. The Expected Delivery Date is a custom field on the Order object that stores the date when the order is expected to be delivered to the customer. The developer can use the @wire decorator to get the current order object and use its properties, such as order number, status, total amount, and expected delivery date, to display them on the order page. The developer can also use Apex methods or third-party APIs to calculate and update the expected delivery date based on various factors, such as inventory availability, shipping method, shipping address, and carrier service level. Displaying the expected delivery date on the order page allows the customer to see their delivery time estimate at any time and reduce their need to call customer service. Adding the Expected Delivery Date field to the order confirmation email is not a good solution, as it does not allow the customer to see their delivery time estimate if they lose or delete their email. Adding a Desired Delivery Date input field during the checkout flow is not a good solution either, as it does not guarantee that the customer's desired delivery date will be met or reflect any changes in delivery time due to unforeseen circumstances. Configuring an email alert to the customer when the Expected Delivery Date changes is not a good solution either, as it can create confusion or frustration for the customer if they receive multiple or conflicting emails about their delivery date. Salesforce

Reference:B2B Commerce Developer Guide: Order Object, [B2B Commerce Developer Guide: Order Page], [Lightning Web Components Developer Guide: Call an Apex Method Imperatively]

Which template will correctly display the details message only when areDetailsVisible becomes true given the following code in a Lightning Web Component?

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: C

Explanation:

The template that will correctly display the details message only when areDetailsVisible becomes true given the following code in a Lightning Web Component is option C. Option C uses the if:true directive to conditionally render a template block based on the value of areDetailsVisible. If areDetailsVisible is true, the template block inside the <template if:true={areDetailsVisible}> tag will be rendered. Otherwise, it will be skipped. Option A is incorrect because it uses the if:false directive, which does the opposite of if:true. It renders the template block only when areDetailsVisible is false. Option B is incorrect because it uses an invalid syntax for the if directive. The if directive requires a colon (:) after the if keyword, not an equal sign (=). 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: Conditional Rendering,Lightning Web Components Developer Guide: Template Syntax

What are two advantages of using Lightning Data Service?

A.
Communicates with other components
A.
Communicates with other components
Answers
B.
Converts between different data formats
B.
Converts between different data formats
Answers
C.
Combines and de-duplicates server calls
C.
Combines and de-duplicates server calls
Answers
D.
Loads record data progressively
D.
Loads record data progressively
Answers
Suggested answer: C, D

Explanation:

Two advantages of using Lightning Data Service are that it combines and de-duplicates server calls and that it loads record data progressively. Lightning Data Service is a service that provides access to Salesforce data and metadata in Lightning web components. It optimizes performance and minimizes server round trips by caching data on the client side and sharing data across components. It also combines and de-duplicates server calls by batching requests for the same record or object and returning a single response. It also loads record data progressively by returning available cached data first and then fetching updated data from the server asynchronously. Communicating with other components and converting between different data formats are not advantages of using Lightning Data Service, as they are not related to its functionality or features. Salesforce

Reference:Lightning Web Components Developer Guide: Lightning Data Service,Lightning Web Components Developer Guide: Work with Salesforce Data

What is likely to happen if a developer leaves debug mode turned on in an environment?

A.
The performance of the org will become slower each day
A.
The performance of the org will become slower each day
Answers
B.
The user will begin getting JavaScript limit exceptions
B.
The user will begin getting JavaScript limit exceptions
Answers
C.
The org will turn off debug mode after 72 hours
C.
The org will turn off debug mode after 72 hours
Answers
D.
A banner will be displayed to the user indicating that the org is in debug mode
D.
A banner will be displayed to the user indicating that the org is in debug mode
Answers
Suggested answer: B

Explanation:

If a developer leaves debug mode turned on in an environment, the user will begin getting JavaScript limit exceptions. Debug mode is a setting that enables more detailed logging and error reporting for Lightning web components. However, it also increases the size and complexity of the JavaScript code that is delivered to the browser, which can cause performance issues and JavaScript limit exceptions. The JavaScript limit exceptions are errors that occur when the browser reaches its maximum capacity for executing JavaScript code, such as memory heap size or script execution time. The performance of the org will not become slower each day, as debug mode only affects the client-side performance, not the server-side performance. The org will not turn off debug mode after 72 hours, as debug mode is a persistent setting that can only be changed manually by an administrator. A banner will not be displayed to the user indicating that the org is in debug mode, as debug mode is a transparent setting that does not affect the user interface. Salesforce

Reference: Lightning Web Components Developer Guide: Debug Your Code, Lightning Web Components Developer Guide: JavaScript Limit Exceptions

A developer has created a custom Lightning web component to display on the Product Detail page in the store. When the developer goes to add the component to the page in Experience Builder, it is missing from the list of custom components.

Which XML fragment should the developer include in the component's configuration XML file to ensure the custom component is available to add to the page?

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: B

Explanation:

The XML fragment that the developer should include in the component's configuration XML file to ensure the custom component is available to add to the page is option B. Option B uses the <targets> tag to specify where the component can be used in an app. The <targets> tag contains a list of <target> tags, each of which defines a valid target for the component. The value of the <target> tag for the Product Detail page in the store is lightningCommunity__RecordPage, which means that the component can be used on any record page in a Lightning community. Option A is incorrect because it uses an invalid value for the <target> tag. There is no such target as lightningCommunity__ProductDetailPage. Option C is incorrect because it uses an invalid syntax for the <targets> tag. The <targets> tag should not have any attributes, such as isAvailable. Option D is incorrect because it uses an invalid syntax for the <target> tag. The <target> tag should not be self-closing, but rather have a closing tag (</target>). Salesforce

Reference:Lightning Web Components Developer Guide: Configure Components for Lightning Communities,Lightning Web Components Developer Guide: Configure Components for Different Pages and Apps

Which two statements are accurate about the Cart Item with a Type of Charge?

A.
It is created with the Cart Delivery Group Method after the shipping integration
A.
It is created with the Cart Delivery Group Method after the shipping integration
Answers
B.
It is created with the Cart Delivery Group Method after the freight integration
B.
It is created with the Cart Delivery Group Method after the freight integration
Answers
C.
It is linked directly to a Cart Id
C.
It is linked directly to a Cart Id
Answers
D.
It is linked directly to a Catalog Id
D.
It is linked directly to a Catalog Id
Answers
Suggested answer: C, D

Explanation:

Two statements that are accurate about the Cart Item with a Type of Charge are that it is linked directly to a Cart Id and that it is linked directly to a Catalog Id. A Cart Item with a Type of Charge is a special type of Cart Item that represents an additional charge or fee that is applied to a Cart, such as shipping, handling, or tax. A Cart Item with a Type of Charge is linked directly to a Cart Id, which means that it belongs to a specific Cart and can be retrieved or updated along with other Cart Items. A Cart Item with a Type of Charge is also linked directly to a Catalog Id, which means that it references a specific Catalog that contains the products and prices for the store. A Cart Item with a Type of Charge is not created with the Cart Delivery Group Method after the shipping integration or after the freight integration, as these are not related to the creation of Cart Items. The Cart Delivery Group Method is a method that determines how products are grouped into delivery groups based on their shipping methods and addresses. The shipping integration and the freight integration are integrations that calculate and apply shipping costs and freight charges to a Cart or an Order. Salesforce

Reference:B2B Commerce Developer Guide: Cart Item Object, B2B Commerce Developer Guide: Shipping Integration, B2B Commerce Developer Guide: Freight Integration

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
A.
Ignored during recalculation
Answers
B.
Saved prior to recalculation
B.
Saved prior to recalculation
Answers
C.
Deleted from the Cart
C.
Deleted from the Cart
Answers
D.
Modified with the new tax calculation
D.
Modified with the new tax calculation
Answers
Suggested answer: C

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

Reference: B2B Commerce Developer Guide: Tax Integration, B2B Commerce Developer Guide: Tax Calculation Flow

Which three actions must a developer take, in a B2B Commerce store, to accept credit card payments using a client's chosen payment provider?

A.
Create a named credential for authentication with the payment provider.
A.
Create a named credential for authentication with the payment provider.
Answers
B.
Create a RegisteredExternalService record for the custom payment provider class.
B.
Create a RegisteredExternalService record for the custom payment provider class.
Answers
C.
Create an Apex class that implements the sfdc_checkout.PaymentGatewayAdapter
C.
Create an Apex class that implements the sfdc_checkout.PaymentGatewayAdapter
Answers
D.
Create a PaymentProviderGateway record for the custom payment provider class.
D.
Create a PaymentProviderGateway record for the custom payment provider class.
Answers
E.
Create an Apex class that implements the commercepayments.PaymentGatewayAdapter.
E.
Create an Apex class that implements the commercepayments.PaymentGatewayAdapter.
Answers
Suggested answer: A, C, D

Explanation:

Three actions that a developer must take, in a B2B Commerce store, to accept credit card payments using a client's chosen payment provider are: create a named credential for authentication with the payment provider, create an Apex class that implements the sfdc_checkout.PaymentGatewayAdapter interface, and create a PaymentProviderGateway record for the custom payment provider class. Creating a named credential for authentication with the payment provider allows the developer to securely store and manage authentication information, such as username, password, token, or certificate, for connecting to the payment provider's API or service. Creating an Apex class that implements the sfdc_checkout.PaymentGatewayAdapter interface allows the developer to define custom logic for processing credit card payments using the payment provider's API or service. The interface provides methods for validating credit card information, authorizing payments, capturing payments, voiding payments, and refunding payments. Creating a PaymentProviderGateway record for the custom payment provider class allows the developer to register the custom payment provider class as a payment gateway in the store and associate it with a payment method. Creating a RegisteredExternalService record for the custom payment provider class is not a required action, as this is only used for registering external services that are not related to payment processing, such as tax or shipping services. Creating an Apex class that implements the commercepayments.PaymentGatewayAdapter interface is not a required action either, as this is only used for D2C Commerce stores, not B2B Commerce stores. Salesforce

Reference: B2B Commerce Developer Guide: Payment Integration, B2B Commerce Developer Guide: Payment Gateway Adapter Interface, B2B Commerce Developer Guide: Payment Provider Gateway Object

Total 221 questions
Go to page: of 23