B2B-Commerce-Developer Practice Test

Salesforce Spring 25 Release -
Updated On 18-Sep-2025

211 Questions

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:

To establish communication between components that are not in the same DOM (Document Object Model) tree, a developer can use the publish-subscribe pattern. The publish-subscribe pattern is a messaging pattern that allows components to communicate with each other without being directly connected or aware of each other. The components can publish events to a common channel and subscribe to events from that channel. The channel acts as a mediator that delivers the events to the subscribers. The developer can use a custom library or a Salesforce platform service, such as Lightning Message Service or Platform Events, to implement the publish-subscribe pattern. Configuring the targets property is not a way to communicate between components that are not in the same DOM tree, as it only defines where a component can be used in an app. Using dispatch events is not a way either, as it only works for components that are in the same DOM tree or have a parent-child relationship.

Using @api decorators is not a way either, as it only exposes public properties or methods of a component to other components that use it.

Salesforce References: Lightning Web Components Developer Guide: Communicate AcrossSalesforce UI Technologies, Lightning Web Components Developer Guide: Communicate with Events, [Lightning Web Components Developer Guide: Communicate with Properties]

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:

Three ways to test the value of Page Label on any Salesforce B2B Commerce Community Page are:

Execute CCRZ.pagevars.pageLabels[‘PAGE_LABEL_NAME’] in the JavaScript console. This will return the value of the page label with the given name from the pagevars object, which contains all the page labels that are used on the page. Execute CCRZ.processPageLabelMap(‘PAGE_LABEL_NAME’) in the JavaScript console. This will return the value of the page label with the given name from the pageLabelMap object, which contains all the page labels that are defined in CCAdmin.

Enable the ‘display page label names’ in cc admin. This will display the name of each page label next to its value on the storefront pages, which can help identify and verify the page labels.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Page Labels

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:

Two viable ways that a developer can import some new product data contained in a JSON file one time are running a command like: sfdx force:data:tree:import -f NewProducts.json - u and converting the JSON to a CSV file and using Data Loader to import it. Running a command like: sfdx force:data:tree:import -f NewProducts.json -u allows the developer to import data from a JSON file into an org using Salesforce CLI commands. The sfdx force:data:tree:import command is a Salesforce CLI command that imports data into an org using JSON files that conform to the SObject Tree API specification. The SObject Tree API specification is a format that defines how records are represented in JSON files for data import or export. The -f flag specifies the path of the JSON file that contains the data to be imported. The -u flag specifies the username or alias of the org where the data will be imported. Running this command will create records in the org based on the data in the JSON file. Converting theJSON to a CSV file and using Data Loader to import it allows the developer to import data from a CSV file into an org using Data Loader. Data Loader is a tool that allows users to import or export data between Salesforce and CSV files. The developer can use an online converter or a spreadsheet application to convert their JSON file into a CSV file that matches the structure and format of their Salesforce object.

The developer can then use Data Loader to import the CSV file into their org and create records based on the data in the CSV file. Converting the JSON to an xlsx file and using Workbench to import it is not a viable way to import some new product data contained in a JSON file one time, as Workbench does not support xlsx files for data import or export. Workbench is a web-based tool that provides access to various Salesforce features and functionalities, such as data manipulation, REST Explorer, and Apex Execute. Running a command like: sfdx force:data;import:bulk -f NewProducts.json -u is not a viable way either, as there is no such command as sfdx force:data;import:bulk. The correct command for importing data using bulk API is sfdx force:data:bulk:upsert.

Salesforce References: [Salesforce CLI Command Reference: force:data:tree:import], [Salesforce Developer Tools for Visual Studio Code], [Data Loader Guide: Import Data into Salesforce], [Workbench], [Salesforce CLI Command Reference: force:data:bulk:upsert]

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:

The Salesforce B2B Commerce object that needs to have a record added when defining a new Subscriber Page to be rendered in a CC Page is CC Subscriber Pages. This is a custom object that stores information about the Subscriber Pages, such as the name, description, URL, and Visualforce page. To create a new Subscriber Page, the user needs to create a new record in this object and specify the required fields. The user can then select the Subscriber Page from the CC Page Settings configuration in CCAdmin.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Subscriber Pages

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:

To modify the out-of-the-box checkout flow template in Salesforce B2B Commerce, a developer should clone the existing template, make the necessary modifications, activate the modified template, and then reference it in the Experience Builder. This approach ensures that the original template remains intact and provides a fallback option. Salesforce documentation on customizing the checkout flow in B2B Commerce emphasizes the importance of using the Experience Builder for such customizations, providing a visual interface to manage and reference different checkout flow templates.

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