Salesforce Accredited B2B Commerce Developer Professional (AP-202) Exam Questions

Page: 1 / 14
Total 221 questions
Question 1

A developer needs to create an event listener on a parent component programmaticallv. With the script below, what should replace the text ?



Answer : C

To create an event listener on a parent component programmatically, the developer should use the following line of code:

this.template.addEventListener('notification', this.handleNotification);

This line of code adds an event listener to the template element of the parent component, which is the root element that contains all the child elements. The event listener listens for an event named 'notification', which is a custom event that can be dispatched by any child component. The event listener invokes a method named handleNotification, which is an arrow function defined in the parent component class. The handleNotification method receives the event object as a parameter and can perform any logic based on the event data. The other lines of code are either incorrect or incomplete. Salesforce Reference: Lightning Web Components Developer Guide: Communicate with Events, Lightning Web Components Developer Guide: Create and Dispatch Events


Question 2
Question 3

A developer is working on an existing checkout implementation built against the Lightning Web Runtime (LWR) and wants to implement a custom child checkout component to modify out-of-the-box functionality.

Which interface must the developer implement for the child component?



Answer : D

:To implement a custom child checkout component for a B2B or B2C store created with an LWR template, the developer must implement the CheckoutStep interface from thecommerce/checkoutmodule. This interface defines the methods and properties that the child component must have to communicate with the parent checkout component and the checkout data provider. The CheckoutStep interface extends the UseCheckoutComponent interface, which provides the common functionality for all checkout components, such as loading and saving data, reporting validity, and handling errors.

The other options are not correct because:

A) CheckoutSavable is not a valid interface for a custom child checkout component. There is no such interface in thecommerce/checkoutmodule or the Lightning web component framework.

B) Checkoutoutinterface is not a valid interface for a custom child checkout component. There is no such interface in thecommerce/checkoutmodule or the Lightning web component framework.

C) CustomCheckout is not a valid interface for a custom child checkout component. There is no such interface in thecommerce/checkoutmodule or the Lightning web component framework.


Create a Custom Checkout Component for a B2B or B2C Store (LWR)

CheckoutStep Interface

UseCheckoutComponent Interface

Question 4

Which two aspects are applicable to Page Includes? (2 answers)



Answer : A, C

Two aspects that are applicable to Page Includes are:

Standard Visualforce controls such as apex:form should not be used within a page include. This is because the page include is rendered inside an existing Visualforce page that already has a form element. Using another form element inside the page include will cause conflicts and errors. Instead, the page include should use HTML elements or custom components that do not require a form element.

Page Includes can be configured as Body Includes Begin. This means that the page include will be rendered at the beginning of the body section of the page, before any other content or widgets. This can be useful for adding some custom content or functionality that applies to the whole page, such as a banner, a modal, or a script. Salesforce Reference:B2B Commerce and D2C Commerce Developer Guide,Page Includes


Question 5

During checkout flow customizations, a developer receives an error on shipping cost calculation integrations with the error code: INSUFFICIENT_ACCESS_OR_READONLY.

What is causing this error?



Answer : D

The error code INSUFFICIENT_ACCESS_OR_READONLY is caused by the cart being no longer in a valid Checkout State during checkout flow customizations. A cart is an object that represents a collection of products and charges that a customer intends to purchase in the storefront. A cart has a Checkout State field that indicates the current state of the checkout process for the cart. The Checkout State can have values such as Draft, InProgress, Completed, or Cancelled. A cart can only be modified or updated when it is in Draft or InProgress state. A cart cannot be modified or updated when it is in Completed or Cancelled state. If an attempt is made to modify or update a cart that is in Completed or Cancelled state, an error with the code INSUFFICIENT_ACCESS_OR_READONLY will be thrown. This error means that the user does not have permission to edit or delete a record because it is read-only or locked. The storefront user does not have access to the Cart Delivery Method object is not a cause of this error code, as it is not related to the cart checkout state or data modification. The Cart Delivery Method object is an object that stores information about the delivery method selected for a cart in the storefront. An error has occurred during the cart shipping charge integration is not a cause of this error code either, as it is not related to the cart checkout state or data modification. The cart shipping charge integration is an integration that calculates and applies shipping charges to a cart based on various factors such as delivery method, location, weight, volume, etc. The storefront user does not have access to custom fields on the Order Delivery Method object is not a cause of this error code either, as it is not related to the cart checkout state or data modification. The Order Delivery Method object is an object that stores information about the delivery method selected for an order summary in the storefront. Salesforce Reference:B2B Commerce Developer Guide: Cart Object, [B2B Commerce Developer Guide: Cart Delivery Method Object], [B2B Commerce Developer Guide: Order Delivery Method Object], [Salesforce Help: Common Error Messages]


Question 6

Northern Trail Outfitters (NTO) wants to be able to reference historical data in another system from the Salesforce user experience as read-only, but does not want to import the data into the

org or incur storage costs. What is one product feature that could accomplish this?



Answer : C

The correct answer isExternal Objects.External objects are similar to custom objects, except that they map to data that's stored outside your Salesforce org12.You can use external objects to access data in real time via web service callouts, without copying the data into your org12.External objects are read-only by default, but you can enable write operations for some data sources12.

Big Objects are not the correct answer. Big objects allow you to store and manage massive amounts of data on the Salesforce platform. However, big objects are not suitable for referencing historical data in another system, as they require importing the data into the org and incur storage costs.

Lightning Out is not the correct answer. Lightning Out is a feature that lets you run Lightning components in any container outside the Salesforce platform. However, Lightning Out does not provide a way to reference historical data in another system, as it is mainly used for embedding Lightning components in other web pages or apps.

External SOQL queries in Apex code are not the correct answer. External SOQL queries are a way to query data from external data sources using SOQL syntax in Apex code. However, external SOQL queries require defining an external data source and an external object first, so they are not a product feature by themselves, but rather a way to use external objects in Apex code.Reference:

B2B Commerce on Lightning Experience Developer Guide

B2B Commerce and D2C Commerce Developer Guide

Salesforce Accredited B2B Commerce Developer

Work with External Data Sources

Access External Data With Salesforce Connect

Migrate data from one organization to another

Monitor Login History

[Big Objects]

[Lightning Out]

[External SOQL Queries]


Question 7

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?



Answer : B

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


Page:    1 / 14   
Total 221 questions