Last Updated On : 20-Feb-2026


Salesforce Accredited B2B Commerce Developer - AP-202 Practice Test

Prepare with our free Salesforce Accredited B2B Commerce Developer - AP-202 sample questions and pass with confidence. Our B2B-Commerce-Developer practice test is designed to help you succeed on exam day.

211 Questions
Salesforce 2026

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

A. Use publish-subscribe pattern.

B. Configure targets property.

C. Use dispatch events.

D. Use @api decorators.

A.   Use publish-subscribe pattern.

Explanation:

When components are not in the same DOM tree (meaning they don't have a direct parent-child relationship), standard DOM event bubbling doesn't work for communication. The publish-subscribe (pub/sub) pattern is an effective way to establish communication between such decoupled components.

In the publish-subscribe pattern:
* Components can publish (emit) events to a central channel
* Other components can subscribe to that channel to listen for specific events
* This allows components anywhere in the application to communicate without needing to know about each other's existence or location in the DOM

In Salesforce B2B Commerce, this pattern is implemented through CCRZ.pubSub, which extends Backbone.Events and provides the central event channel for component communication.

Why the other options are incorrect:

B. Configuring a targets property:
Not a standard pattern for cross-component communication in Salesforce B2B Commerce or LWC.

C. Using dispatch events:
Works for parent-child communication through DOM event bubbling, but requires the components to be in the same DOM tree hierarchy.

D. Using the @api decorator:
Used in LWC to expose public properties and methods, but only enables communication between parent and child components, not between components in different DOM trees.

Reference:
Salesforce B2B Commerce Developer Guide: Event Handling with CCRZ.pubSub
Lightning Web Components Developer Guide: Component Communication

What are three ways to test the value of Page Label on any Salesforce B2B Commerce Community Page? (3 answers)

A. Access the source HTML for the page viathe browser developer tools.

B. Execute CCRZ.pagevars.pageLabels['PAGE_LABEL_NAME') in the JavaScript console.

C. Execute CCRZ.processPageLabelMap('PAGE_LABEL_NAME') in the JavaScript console.

D. Enable the 'display page label names' in cc admin.

E. Execute (('PAGE_LABEL_NAME')) in the JavaScript console

B.   Execute CCRZ.pagevars.pageLabels['PAGE_LABEL_NAME') in the JavaScript console.
C.   Execute CCRZ.processPageLabelMap('PAGE_LABEL_NAME') in the JavaScript console.
D.   Enable the 'display page label names' in cc admin.

Explanation

In Salesforce B2B Commerce Classic, Page Labels provide localized text throughout the storefront. Testing these labels ensures the correct key-value mapping is active:

CCRZ.pagevars.pageLabels (B):
On the client side, the B2B Commerce framework stores loaded page labels in a global JavaScript object. You can inspect this directly in the browser console to see the currently loaded value for a specific key.

CCRZ.processPageLabelMap (C):
This is the core JavaScript function used by the B2B Commerce logic to retrieve and process labels. Executing it in the console allows you to simulate how the framework resolves a specific label key.

Display Page Label Names (D):
This is a powerful debugging feature in CC Admin. When enabled, the storefront replaces the translated text with the actual Label Name (e.g., instead of "Add to Cart," you see "Cart_Add"). This makes it incredibly easy to identify which label key is being used by a specific UI element.

Why other options are incorrect

A. Access source HTML:
Incorrect. Page labels are typically rendered as plain text within tags. The HTML source will show the value (e.g., "Checkout"), but it will not tell you the key (e.g., CheckOut_Title) unless the "Display Page Label Names" setting (Option D) is already active.

E. Execute (('PAGE_LABEL_NAME')):
Incorrect. This is not a valid JavaScript command or a recognized Salesforce B2B Commerce framework function.

Pro-tip for the Exam:
If you update a Page Label in CC Admin, remember that you must Build and Activate a new Configuration Cache before any of these testing methods (except Option D) will reflect the new value.

A developer needs to import some new product data contained in a JSON file one time. What are two viable ways to do this? .

A. Convert the JSON to an xlsx file and use Workbench to import it

B. Run a command like: sfdx force:data:tree:import -f NewProducts.json -u

C. Convert the JSON to a CSV file and use Data Loader to import it

D. Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u

B.    Run a command like: sfdx force:data:tree:import -f NewProducts.json -u
C.   Convert the JSON to a CSV file and use Data Loader to import it

Explanation:

When importing new product data from a JSON file one time into Salesforce, there are two viable approaches:

SFDX Tree Import (B):
The Salesforce CLI (sfdx) supports importing hierarchical data directly from JSON using the force:data:tree:import command.
This is especially useful when the JSON represents related records (e.g., Products with Pricebooks).

Convert JSON → CSV and use Data Loader (C):
If the JSON is flat (simple records), you can convert it into a CSV file and use Data Loader to import the records.
Data Loader is the standard tool for bulk imports and supports CSV format only.

Why the other options are incorrect

A. Convert the JSON to an XLSX file and use Workbench:
Incorrect. Workbench does not support XLSX imports; it supports CSV.

D. Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u:
Incorrect. Invalid command; there is no force:data;import:bulk in Salesforce CLI.

Reference
Salesforce CLI Guide: force:data:tree:import – Imports data into an org from JSON files. Useful for hierarchical data.
Salesforce Data Loader Guide: Import Data from CSV Files

Which Salesforce B2BCommerce object needs to have a record added when defining a new Subscriber Pages to be rendered in a CC Page?

A. CC Storefront Assosiation

B. CC Admin

C. CC Page Sections

D. CC Subscriber Pages

D.   CC Subscriber Pages

Explanation:

To register a new custom page so that the managed package knows how to route requests and apply the correct storefront theme, you must create a record in the CC Subscriber Page (ccrz__E_SubscriberPage__c) custom object.

The Purpose:
This record acts as a "map." It links a specific Page Key (a unique string used in the URL, such as MyCustomPromotion) to a specific Visualforce Page name you have developed.

The Configuration:
When a user navigates to .../DefaultStore?page=MyCustomPromotion, the B2B Commerce engine looks at the CC Subscriber Pages records. If it finds a match for that key, it renders your custom Visualforce page inside the storefront’s standard layout.

Storefront Scoping:
You can also specify which storefront the subscriber page belongs to, allowing different stores in the same org to have unique custom pages using the same key.

Detailed Analysis of Incorrect Answers

A. CC Storefront Association:
This is incorrect. This object is generally used to link different records (like Price Books or Categories) to a specific storefront. While related to storefront configuration, it is not the mechanism used to define or render custom Visualforce pages.

B. CC Admin:
This is incorrect. While you use the CC Admin interface to manage settings and sometimes refresh caches, it is not an object where you add a record to define a new page. The CC Admin panel interacts with the underlying objects like CC Subscriber Pages.

C. CC Page Sections:
This is incorrect. Page Sections are typically used to define specific content blocks or "widgets" within a page (like a banner or a sidebar), but they do not define the high-level routing for a standalone Subscriber Page.

References:
Salesforce B2B Commerce Developer Guide

What does a developer need to do to modify the out-of-the-box checkout flow template?

A. Clone, modify, activate and refer in Experience Builder

B. Modify directly and save to activate

C. Create each flow from scratch

D. Clone, modify and rename to Checkout Flow

A.   Clone, modify, activate and refer in Experience Builder

Explanation:

In Salesforce B2B Commerce, the out-of-the-box checkout flow is part of managed package functionality and should never be modified directly.

Salesforce best practice is:
* Clone the standard checkout flow template.
* Modify the cloned version to add or change logic.
* Activate the new flow version.
* Reference/select the new flow in Experience Builder (or storefront configuration) so the site uses it.

This ensures:
* Upgrade safety
* Managed package compatibility
* Ability to revert to the original flow if needed

Why the Other Options Are Incorrect

B. Modify directly and save to activate:
Incorrect. Managed package flows should not be edited directly. Direct modification risks breaking upgrades and is typically restricted.

C. Create each flow from scratch:
Incorrect. Not required and not recommended. The out-of-the-box flow already contains required checkout orchestration logic.

D. Clone, modify and rename to Checkout Flow:
Incorrect. Renaming alone is insufficient. The flow must also be activated and configured in Experience Builder to be used.

Salesforce Concept Reference
Checkout customization process:
* Clone managed flows
* Customize safely
* Activate new version
* Assign in storefront configuration

Related topics:
* Checkout Flow Customization
* Experience Builder configuration
* Managed package upgrade-safe practices

AP-202 Exam Tip
Whenever the question mentions modifying out-of-the-box functionality:
* Never edit directly.
* Clone → Modify → Activate → Configure.

This pattern appears frequently in B2B Commerce exam questions.

B2B-Commerce-Developer Exam Questions - Home
Page 2 out of 43 Pages