B2B-Commerce-Developer Practice Test

Salesforce Spring 25 Release -
Updated On 1-Jan-2026

211 Questions

Which two statements are accurate?

A. A Lightning Web Component cannot contain an Aura component

B. A Lightning Web Component can contain an Aura component

C. An Aura component can contain a Lightning Web Component which contains an Aura component

D. An Aura component can contain a Lightning Web Component

B.   A Lightning Web Component can contain an Aura component
D.   An Aura component can contain a Lightning Web Component

Explanation:

A Lightning Web Component can contain an Aura component, and an Aura component can contain a Lightning Web Component. This interoperability allows for a smoother transition from Aura to LWC and enables developers to utilize the strengths of both frameworks. However, nesting a Lightning Web Component within an Aura component which in turn contains a Lightning Web Component (Option C) is not a standard practice. For more information, refer to the Salesforce documentation on using Aura and Lightning Web Components together: Salesforce Aura and LWC Interoperability Documentation.

What is a best practice when passing query parameters from user interface to an apex controller?

A. Query parameters should be properly sanitized by using JSINHTMLENCODE within the VisualForce Page or Component.

B. String parameters should be trimmed using String.trim().

C. Query parameters should be passed only to Salesforce B2B Commerce classes that you are extending.

D. Query parameters should be stored on a backbone model prior to passing them to the server

A.    Query parameters should be properly sanitized by using JSINHTMLENCODE within the VisualForce Page or Component.

Explanation:

A best practice when passing query parameters from user interface to an apex controller is to query parameters should be properly sanitized by using JSINHTMLENCODE within the VisualForce Page or Component. This function will encode any special characters in the query parameters to prevent cross-site scripting (XSS) attacks or SOQL injection attacks. For example, ccrz.ccRemoteActions.getProducts('{!JSINHTMLENCODE(searchTerm)}') will encode the searchTerm parameter before passing it to the apex controller.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Security

CheckoutSavable

A. CheckoutSavable

B. Checkoutoutinterface

C. CustomCheckout

D. CheckoutStep

D.   CheckoutStep

Explanation:

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 the commerce/checkout module. 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.

Which two statements are true regarding the cc_CallContext class in Salesforce B2B Commerce? (2 answers)

A. The Salesforce session is accessible via the getSession method

B. The class can be used internally within Salesforce B2B Commerce and in subscriber code to access context level parameters

C. The userLocale variable returns the current Locale for storefront.

D. The current storefront is accessible via thisclass

B.   The class can be used internally within Salesforce B2B Commerce and in subscriber code to access context level parameters
D.   The current storefront is accessible via thisclass

Explanation:

The cc_CallContext class is a utility class that provides access to various context level parameters, such as the current storefront, user, cart, price list, currency, locale, and session. The class can be used internallywithin Salesforce B2B Commerce and in subscriber code to access these parameters. The current storefront is accessible via this class by using the getStorefront method, which returns a cc_Storefront__c object. The userLocale variable returns the current Locale for storefront, but it is not part of the cc_CallContext class. It is a global variable that can be accessed from any Visualforce page or component by using {!userLocale}. The Salesforce session is accessible via the getSession method, but it is not part of the cc_CallContext class either. It is a method of the cc_SessionUtil class, which is another utility class that provides methods for managing sessions.

Salesforce References: [B2B Commerce Developer Guide: cc_CallContext Class], [B2B Commerce Developer Guide: cc_SessionUtil Class]

What are two considerations to keep in mind when including additional JavaScript files in a Lightning web component?

A. Each additional file needs a corresponding .js-meta.xml file.

B. The files must be ES6 modules and must have names that are unique within the component's folder.

C. A module can export named functions or variables

D. Additional JavaScript files should be minified before deployment

B.   The files must be ES6 modules and must have names that are unique within the component's folder.
C.   A module can export named functions or variables

Explanation:

When including additional JavaScript files in a Lightning web component, a developer should keep in mind two considerations: the files must be ES6 modules and must have names that are unique within the component’s folder and a module can export named functions or variables. The files must be ES6 modules because LWC uses ES6 modules as the standard for modular JavaScript code. The files must have names that are unique within the component’s folder because LWC uses the file name as the module identifier and does not allow duplicate identifiers. A module can export named functions or variables because LWC supports named exports, which allow a module to export multiple values with different names. Each additional file does not need a corresponding .jsmeta.xml file, as this is only required for the main JavaScript file of the component. Additional JavaScript files should not be minified before deployment, asthis is not necessary or recommended for LWC.

Salesforce References: [Lightning Web Components Developer Guide: Include JavaScript Files], [Lightning Web Components Developer Guide: ES6 Modules]

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