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

Page: 1 / 14
Total 221 questions
Question 1

Which two Salesforce B2B Commerce visualforce pages must be enabled at a Salesforce Community level to make the out of the box SEO functionality available? (2 answers)



Answer : A, C

Two Salesforce B2B Commerce Visualforce pages that must be enabled at a Salesforce Community level to make the out of the box SEO functionality available are:

CCSizeIndex: This page generates a sitemap.xml file, which is a file that lists all the pages and resources on a site that can be crawled by web crawlers. The page uses the configuration settings CO.SiteMapIncludeProducts and CO.SiteMapIncludeCategories to specify which products and categories should be included in the sitemap.

CCCatSiteMap: This page generates a category sitemap file, which is a file that lists all the categories on a site that can be crawled by web crawlers. The page uses the configuration setting CO.SiteMapCategoryDepth to specify how many levels of subcategories should be included in the category sitemap. Salesforce Reference:B2B Commerce and D2C Commerce Developer Guide,Sitemap Files


Question 2

Which two scoped modules should a developer import in Lightning web components to check user permissions?



Answer : A, B

To check user permissions in Lightning web components, a developer should import two scoped modules: @salesforce/permission and @salesforce/customPermission. The @salesforce/permission module allows the developer to check if the user has access to a standard permission, such as View Setup or Modify All Data. The @salesforce/customPermission module allows the developer to check if the user has access to a custom permission, such as Enable Debug Mode or Manage Orders. The other modules do not exist or are not related to user permissions. Salesforce Reference: Lightning Web Components Developer Guide: Check User Permissions, Lightning Web Components Developer Guide: Import Salesforce Modules


Question 3

Which two practices are allowed when it comes to naming a Lightning Web Components folder and associated files?



Answer : A, C

When naming a Lightning Web Components folder and associated files, Salesforce best practices allow the name to begin with a lowercase letter and to use a single hyphen (dash) for compound names. Whitespace and underscores are not recommended in the naming convention. This is in line with web standards for custom elements. More details can be found in the Salesforce LWC documentation on naming conventions: Salesforce LWC Naming Conventions.


Question 4

Which two methods should a developer implement in a Lightning web component to successfully handle the subscription lifecycle of a Message Channel?



Answer : A, D

To handle the subscription lifecycle of a message channel in a Lightning web component, the developer should implement thesubscribe()andunsubscribe()methods from thelightning/messageServicemodule. Thesubscribe()method returns a subscription object that represents the connection to the message channel. The developer can use this object to unsubscribe from the message channel later. Theunsubscribe()method takes a subscription object as a parameter and removes the listener from the message channel. The developer should call theunsubscribe()method when the component is disconnected from the DOM, such as in thedisconnectedCallback()lifecycle hook, to avoid memory leaks and performance issues.

The other options are not correct because:

B) stopListener() is not a valid method for handling the subscription lifecycle of a message channel. There is no such method in thelightning/messageServicemodule or the Lightning web component framework.

C) startListener() is not a valid method for handling the subscription lifecycle of a message channel. There is no such method in thelightning/messageServicemodule or the Lightning web component framework.


Subscribe and Unsubscribe from a Message Channel

Lifecycle Hooks

Use message channel in both direction

Question 5

What happens to all previous tax entries during tax implementation?



Answer : C

In general best practices for tax implementation in systems like Salesforce B2B Commerce, previous tax entries are usually preserved or saved before any recalculation is performed. This ensures that there is a record of the original tax calculations before any modifications, which can be crucial for auditing, historical data integrity, and in case the new tax calculation needs to be rolled back for any reason.


Question 6

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?



Answer : C

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]


Question 7

In a B2B Commerce store, which three tasks must a developer complete to implement the use of a third-party service for either tax, shipping, or pricing calculation?



Answer : A, C, D

To implement the use of a third-party service for either tax, shipping, or pricing calculation in a B2B Commerce store, a developer must complete these three tasks:

Create an Apex class that implements the appropriate interface for the calculation type. For example, for tax calculation, the developer must implement the sfdc_checkout.CartTax interface and define the getTax method. This method takes a Cart object as an input parameter and returns a list of CartTax objects with the calculated tax amounts.

Create a named credential for authentication with the external service. A named credential specifies the URL of a callout endpoint and its required authentication parameters. The developer can use the named credential in the Apex class to make the callout to the external service and handle the response.

Register the Apex class as the integration in the store administration. The developer must specify the Apex class name in the corresponding field for the calculation type. For example, for tax calculation, the developer must enter the Apex class name in the Tax Calculation Integration field. This way, the store can invoke the Apex class to perform the calculation for each cart.

The other options are not valid tasks for implementing the use of a third-party service. Creating a flow to call the external service directly is not supported for B2B Commerce, and creating an Apex class with an invocable method is not required for the calculation integration.Reference:

Integrate with External Services

CartTax Interface

Named Credentials

[Store Administration]


Page:    1 / 14   
Total 221 questions