Last Updated On : 28-Sep-2026


Salesforce Certified B2C Commerce Cloud Developer - Comm-Dev-101 Practice Test

Prepare with our free Salesforce Certified B2C Commerce Cloud Developer - Comm-Dev-101 sample questions and pass with confidence. Our Salesforce-B2C-Commerce-Cloud-Developer practice test is designed to help you succeed on exam day.

154 Questions
Salesforce 2026

A developer needs to update the package.json file so that it points to the hook file for a cartridge, using the hooks keyword. Which snippet works correctly when added to the file?

A. { " hooks " : " ./cartridge/scripts/hooks.json " }

B. { hooks: ./cartridge/scripts/hooks.json }

C. { " hooks " : " ./scripts/hooks.json " }

A.   { " hooks " : " ./cartridge/scripts/hooks.json " }

Explanation

In Salesforce B2C Commerce (SFCC), cartridges use a `package.json` file to declare cartridge-level configuration, including the location of the hooks definition file under the `"hooks"` keyword. Two things must be correct:

Why the Other Options Are Incorrect

B. `{ hooks: ./cartridge/scripts/hooks.json }`
– This snippet uses unquoted keys (`hooks:`) and an unquoted value (`./cartridge/scripts/hooks.json`). This is invalid JSON syntax. While JavaScript object literals allow unquoted keys, `package.json` must be valid JSON, which requires all keys and string values to be enclosed in double quotes. Because the key and value are unquoted, this snippet would cause a parsing error. Even though the path itself is correct, the syntax is wrong.

C. `{ "hooks": "./scripts/hooks.json" }`
– This snippet has correct JSON syntax (double-quoted key and value), but the path is wrong. It points to `./scripts/hooks.json`, omitting the `cartridge/` directory. In SFCC, the hooks file is located under the cartridge's `cartridge/scripts/` path, so the correct relative path from the cartridge root must include the `cartridge/` folder. This path would not resolve to the actual hooks file location.

Reference

Salesforce B2C Commerce documentation — Cartridge `package.json` configuration, specifically the `"hooks"` property that points to the hooks definition file located under `cartridge/scripts/`, and the requirement that `package.json` be valid JSON (double-quoted keys and string values).

A developer cannot create a custom object in Business Manager because the attributes do not show. The developer can view the object but not the attributes. Which action should the developer take to resolve the problem?

A. Change the data type of the attributes.

B. Create an Attribute Group with the desired attributes in it.

C. Set the attributes to site-specific replicable.

B.   Create an Attribute Group with the desired attributes in it.

Explanation

In Salesforce B2C Commerce (SFCC), Custom Objects are defined with attributes (the data fields), but the attributes that appear when creating or editing Custom Object instances in Business Manager are controlled by Attribute Groups.

The key distinction:

* Attributes define what data the Custom Object can hold (the schema/fields).
* Attribute Groups determine which attributes are displayed and editable in the Business Manager UI, and how they are organized on the instance creation/editing screen.

When a developer can view the object but not its attributes, it is because the attributes have not been added to an Attribute Group. Attributes that exist on the object but are not part of any Attribute Group will not appear in the Business Manager UI when creating/editing instances.

The fix is to create an Attribute Group (or edit an existing one) and include the desired attributes in it. Once the attributes are part of an Attribute Group, they become visible when creating/editing Custom Object instances in Business Manager. This makes option B correct.

Why the Other Options Are Incorrect

A. Change the data type of the attributes.
– Changing the data type of an attribute alters what kind of data it stores (e.g., text, number, boolean). It does not control whether the attribute is visible in Business Manager. The visibility problem is caused by the attribute not being included in an Attribute Group, so changing the data type would not resolve it.

C. Set the attributes to site-specific replicable.
– The site-specific replicable property controls how the attribute's data is replicated across sites (whether values can differ per site and how replication behaves). It does not control visibility in the Business Manager UI for Custom Object instances. Setting this property would not make the attributes appear — the missing piece is the Attribute Group.

Reference

Salesforce B2C Commerce documentation — Custom Objects and Custom Object Attribute Groups in Business Manager (Merchant Tools > Custom Objects / Custom Object Editor), covering how attributes and attribute groups control the display of Custom Object fields in Business Manager.

A developer is working on a feature that requires the use of a third-party API. What is the best practice for handling API responses in Salesforce B2C Commerce?

A. Ignore error responses and proceed with the default behavior.

B. Log all responses for debugging purposes and handle errors gracefully.

C. Always return a success response to the user, regardless of the API response.

B.   Log all responses for debugging purposes and handle errors gracefully.

Explanation

When integrating with a third-party API in Salesforce B2C Commerce (SFCC), the best practice is to log responses for debugging and handle errors gracefully. This approach ensures:

* Observability: Logging API responses (at appropriate log levels) provides visibility into what the third-party service returned, which is essential for troubleshooting issues in production.
* Resilience: Handling errors gracefully means the application doesn't crash or behave unpredictably when the third-party API fails, times out, or returns unexpected data. The storefront can degrade gracefully — showing a fallback message, retrying, or continuing with default behavior where appropriate — rather than breaking the user experience.
* Maintainability: Proper logging and error handling make the integration easier to monitor, debug, and maintain over time.

This aligns with SFCC best practices for service integrations (using the Service framework, logging via `dw.system.Logger`, and handling error callbacks), making option B the correct answer.

Why the Other Options Are Incorrect

A. Ignore error responses and proceed with the default behavior.
– Ignoring error responses is a poor practice. Silently ignoring errors means failures go unnoticed, making debugging difficult and potentially causing incorrect application behavior (e.g., processing an order with missing data). Best practice is to detect, log, and handle errors — not ignore them. While "proceeding with default behavior" can sometimes be a graceful fallback, ignoring the error (without logging/handling) is not acceptable.

C. Always return a success response to the user, regardless of the API response.
– Always returning success regardless of the actual API outcome is misleading and dangerous. It hides failures from the user and from the system, potentially leading to data inconsistencies, unfulfilled transactions, or a broken user experience where the user believes an operation succeeded when it actually failed. This violates the principle of graceful error handling — the correct approach is to handle errors and communicate the appropriate outcome, not to fake success.

Reference

Salesforce B2C Commerce documentation — Service framework and integration best practices, covering logging of API responses (`dw.system.Logger`), graceful error handling (error callbacks, fallback behavior), and the importance of not masking failures.

Given a sandbox with an active slot configuration with the following specifications:
Content type set to product
With some product configured
With the following rendering template:slots/product/product_1x2.isml
Correctly enabled and scheduled
And given the code contained in the selected rendering template:
< isif condition= " ${!empty(slotcontent)} " >
< isloop iterator= " ${slotcontent.content} " alias= " product " >
< div class= " product " >
< isprint value= " ${product.getID()} " > < br / >
< isprint value= " ${product.getName()} " > < br / >
< /div >
< /isloop >
< /isif >
Is an additional action needed for this to work as intended?

A. No - The content slot is rendered correctly.

B. Yes - The isloop should be removed because no loops are allowed in a content slot rendering template.

C. Yes - The content needs to be configured with a recommender to display products.

A.   No - The content slot is rendered correctly.

Explanation

In Salesforce B2C Commerce (SFCC), a content slot with its content type set to product holds a collection of product content (one or more configured products). When the slot is rendered, the slot's content is available in the rendering template via the `slotcontent` object, and the individual product items are accessed through `slotcontent.content` — which is a collection of the configured product objects.

The provided template does exactly this:

* `` — checks that the slot content exists.
* `` — iterates over the collection of products in the slot (correct, because a product content slot can contain multiple products).
* Inside the loop, it prints each product's ID (`${product.getID()}`) and Name (`${product.getName()}`).

This is a valid and correct way to render a product-type content slot. Looping over `slotcontent.content` is the standard pattern for rendering multiple products configured in a product content slot. Since the slot is correctly configured, enabled, scheduled, and the template correctly iterates and renders the products, no additional action is needed — the content slot renders correctly. This makes option A correct.

Why the Other Options Are Incorrect

B. Yes - The `isloop` should be removed because no loops are allowed in a content slot rendering template.
– This is false. Loops are perfectly allowed in content slot rendering templates. In fact, for a product content slot that holds multiple products, a loop (``) over `slotcontent.content` is the correct and necessary way to render each product. Removing the loop would prevent multiple products from being rendered properly. So this option is incorrect.

C. Yes - The content needs to be configured with a recommender to display products.
– A recommender is used for dynamic product recommendations (e.g., "you may also like"), which is a different type of slot content (recommender content). Here, the content type is set to product with products explicitly configured — meaning the slot already has its products assigned directly. A recommender is not required for a product content slot with configured products. Adding a recommender would change the content type/behavior unnecessarily. So this option is incorrect.

Reference

Salesforce B2C Commerce documentation — Content Slots and slot rendering templates, specifically the product content type and the use of `slotcontent` / `slotcontent.content` with `` to render products configured in a slot. Also see documentation on recommenders as a distinct content type.

What is the result when the code segment executes with the logger configuration?

A. Logs will be written to the log file with a prefix custom-loggersFile.

B. Logs will be written to the log file with a prefix custom-loggers.

C. Logs will be written to the log file with a prefix loggerFile.

B.   Logs will be written to the log file with a prefix custom-loggers.

Explanation

In Salesforce B2C Commerce (SFCC), when a suffix is passed to a logger — e.g., via `Logger.getLogger(category, suffix)` — the log output is written to a custom log file. The naming convention for such custom log files is:

Why the Other Options Are Incorrect

A. `custom-loggersFile`
– This adds an extra File segment, which does not correspond to the suffix in the configuration. The suffix is `loggers`, so the prefix is `custom-loggers` — there is no File component appended. This option invents an extra string that is not part of the naming convention.

C. `loggerFile`
– This does not follow the SFCC custom log file naming convention. Custom log files use the `custom-` prefix followed by the suffix. `loggerFile` omits the required `custom-` prefix and uses a string (`loggerFile`) that does not match the suffix (`loggers`). So this is incorrect.

Reference

Salesforce B2C Commerce documentation — Log Settings and the `dw.system.Logger` API, specifically the naming convention for custom log files (`custom-<suffix>`) when a suffix is provided to the logger.

Salesforce-B2C-Commerce-Cloud-Developer Exam Questions - Home Previous
Page 4 out of 31 Pages