Last Updated On : 7-Apr-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.

202 Questions
Salesforce 2026

A developer wants to configure multiple products that should only be sold as a group. It should not be possible for buyers to buy these products individually. How should the developer configure the products?

A. Bundle

B. Set

C. Variation Group

A.   Bundle

Explanation

Salesforce B2C Commerce Product Grouping Options
Salesforce B2C Commerce offers three primary ways to group products: Sets, Bundles, and Variation Groups. The choice between them depends entirely on the business requirement regarding inventory and purchasing behavior.

Understanding the Bundle
A Product Bundle is the correct configuration when multiple products must be sold together as a single unit. In a bundle, the parent product has its own unique ID, but it is composed of several child products. For this requirement, a merchant can configure the storefront so that these items are only purchasable through the bundle. While the individual components can exist in the catalog, the bundle allows them to be added to the cart as a single line item with a single price, which can be different from the sum of the individual products.

Inventory and Price Logic
The inventory of a bundle depends on the availability of its components. If one item in the bundle is out of stock, the entire bundle becomes unorderable. This behavior ensures the group remains intact. From a pricing perspective, the bundle can have its own price, enabling bundled or kit discounts that are not available when purchasing items separately.

Why Sets and Variations Don't Fit
A Product Set is a loose collection of products. On a product set page, a shopper can choose to add individual items from the set or add the entire set. It does not restrict customers from purchasing items individually, which does not meet the requirement.

A Variation Group is used to group products that share a common attribute, such as color or size variations under a master product. It is not intended for combining different types of products (for example, a camera, bag, and lens) into a single mandatory purchasable unit.

References
Salesforce B2C Commerce Help: Product Bundles, Sets, and Variations
Trailhead: Explore Product Types in B2C Commerce

Which method isefficient and scalable because it uses the product search index rather than searching the database?

A. ProducrlndexModel.getOrderableProductsOnly()

B. ProduccAvailabiliryModel.isOrderable()

C. ProductSearcbHodel().gerProductSearchHita()

D. ProductVanari.cnMcciel.aerVariams ()

C.   ProductSearcbHodel().gerProductSearchHita()

Explanation:

The most efficient and scalable method that uses the product search index rather than searching the database is C: ProductSearchModel().getProductSearchHits(). This method leverages the B2C Commerce search index, which is optimized for performance and scalability, to retrieve product search results, making it ideal for large-scale queries compared to direct database searches.

Reasoning:
Search Index vs. Database: B2C Commerce uses a search index (maintained via Business Manager > Merchant Tools > Search > Indexing) to optimize product searches, reducing the load on the database. Methods relying on the index are more efficient for large catalogs or frequent queries.

A. ProductIndexModel.getOrderableProductsOnly()
Incorrect. There is no ProductIndexModel or getOrderableProductsOnly() method in the B2C Commerce Script API. This appears to be a distractor, possibly a misinterpretation of index-related functionality.

B. ProductAvailabilityModel.isOrderable()
Incorrect. The ProductAvailabilityModel.isOrderable() method checks a product’s availability based on inventory data, querying the database directly rather than using the search index. It’s not designed for scalable product searches.

C. ProductSearchModel().getProductSearchHits()
Correct. The ProductSearchModel class (from dw.catalog.ProductSearchModel) uses the search index to retrieve a list of ProductSearchHit objects matching a query. This method is optimized for performance, supporting filters, sorting, and pagination, making it efficient and scalable for storefront search or category pages.
Example:
var ProductSearchModel = require('dw/catalog/ProductSearchModel');
var searchModel = new ProductSearchModel();
searchModel.setCategoryID('categoryID');
searchModel.search();
var hits = searchModel.getProductSearchHits();

D. ProductVariantModel.getVariants()
Incorrect. The ProductVariantModel.getVariants() method retrieves variant products for a master product, querying the database or product catalog directly. It does not utilize the search index, making it less efficient for large-scale searches.

Implementation Note:
The getProductSearchHits() method returns an iterator of ProductSearchHit objects, which include product IDs and relevance scores, optimized for search performance. It’s commonly used in controllers or scripts to power storefront search results.

Reference:
Salesforce B2C Commerce Documentation: ProductSearchModel API details index-based searching.
Trailhead Module: “B2C Commerce Developer” module on “Search and Navigation” covers search index usage.

Exam Tip:
For the Salesforce B2C-Commerce-Developer exam, identify ProductSearchModel().getProductSearchHits() as the index-based method, avoiding distractors with incorrect class names or database-dependent methods. Note typos (e.g., ProducrlndexModel, ProduccAvailabiliryModel) as common exam tricks.

A developer is asked to create a controller endpoint that will be used in a client-side AJAX request. Its purposes is to displayupdated information to the user when the request is completed, without otherwise modifying the appearance of the current page.
According to SFRA practices, which method best supports this objective?

A. res.json()

B. res.render()

C. res.print()

A.   res.json()

Explanation:

Why This Answer Is Correct
The requirement is classic for an AJAX endpoint: a client-side JavaScript request expects structured data (JSON) in response, which it will use to update the page dynamically without a full refresh. The res.json() method in SFRA (inherited from Express.js) is specifically designed for this purpose. It sets the correct Content-Type header to application/json and sends a JSON response. The developer can pass a JavaScript object to res.json(), which will be automatically serialized. This is the standard, clean, and efficient method for API endpoints that serve data to client-side logic. It aligns perfectly with the goal of providing “updated information” in a machine-readable format for JavaScript to process.

Why the Other Options Are Incorrect

B. res.render()
res.render() is used to process an ISML template and send the resulting HTML to the client. It is the standard method for rendering full or partial page views. Using it for an AJAX endpoint would be inefficient and inappropriate, as it would return HTML markup instead of lightweight JSON data. The client-side AJAX handler would then need to parse the HTML to extract data, which is cumbersome and brittle.

C. res.print()
res.print() (or Response.print() in the legacy DWScript API) is a low-level method that writes a raw string to the response stream. It does not set the Content-Type header to application/json. To use it for JSON, a developer would have to manually call JSON.stringify() on an object and then set the content type header, which is more verbose and error-prone than using the dedicated res.json() helper. It is not the best practice in the SFRA context.

Reference
SFRA Controller API Reference: Response Wrapper — Documents the res.json() method as the preferred way to send JSON responses.
Express.js API Documentation: res.json() — Underpins the SFRA implementation.

Given a template rendered by a controller with caching and a remote include without caching, which situation applies?

A. Both the remote include portion and the rest of the page are cached.

B. The remote include portion is not cached, but the rest of the page is cached.

C. The page is cached only for returning customers because of the remote include.

D. The page is not cached because the remote include introduces an uncached portion.

B.   The remote include portion is not cached, but the rest of the page is cached.

Explanation:

This question tests a very important Salesforce B2C Commerce concept: how page caching interacts with remote includes. This topic appears frequently on the Salesforce Certified B2C Commerce Cloud Developer (Comm-Dev-101) exam because misunderstanding it can lead to serious performance or functional issues in production.

Understanding the Scenario:
You are given the following conditions:
- A template is rendered by a controller
- The controller has caching enabled
- The template contains a remote include
- The remote include does NOT have caching enabled

This setup is extremely common in real storefronts. For example:
- A cached Product Details Page
- With a remote include for personalized data (like cart, recommendations, or account info)

The key question is:
Does an uncached remote include disable caching for the entire page?

The answer is no—and that is the critical concept being tested.

Why Answer B Is Correct:
Page Cache and Remote Include Cache Are Independent

In Salesforce B2C Commerce, page caching and remote include caching are evaluated independently.

The main page is cached according to:
- Controller cache middleware
- <iscache> tags

The remote include is treated as a separate HTTP request:
- It can have its own caching rules
- Or no caching at all

If the remote include does not have caching enabled, the platform behaves as follows:
✅ The main page remains cached
❌ The remote include is executed on every request

This allows developers to:
- Cache expensive page rendering
- Still inject dynamic or personalized content
- Avoid disabling page caching entirely

This behavior is by design and is one of the key strengths of B2C Commerce’s caching architecture.

Therefore, Option B is correct:
The remote include portion is not cached, but the rest of the page is cached.

Why the Other Options Are Incorrect:

Option A: Both the remote include and the rest of the page are cached
This is incorrect because:
- The question explicitly states that the remote include does not have caching
- Remote includes do not automatically inherit page cache settings
- If caching is not defined on the remote include route, it is executed every time

Option C: The page is cached only for returning customers
Caching behavior in B2C Commerce:
- Is not dependent on customer type
- Is controlled by cache rules, middleware, and tags
- Does not change simply because a remote include exists

There is no concept where an uncached remote include limits caching to returning customers only.

Option D: The page is not cached because of the remote include
This is one of the most common misconceptions and a frequent exam trap.

An uncached remote include does NOT invalidate or disable the page cache.

If this were true:
- Most SFRA pages would be uncached
- Performance would be severely degraded
- Personalization would be impractical

Salesforce explicitly designed remote includes to allow dynamic content inside cached pages.

Practical Example (Real-World Context):
A common SFRA pattern:
- Page: Cached (category page, PDP, homepage)
- Remote include:
  • Mini-cart
  • Account header
  • Recommendations
  • Inventory status

These remote includes are often not cached, while the page itself is cached. This pattern is safe, supported, and recommended.

Key Takeaway (Exam Rule):
An uncached remote include does NOT disable page caching.
The page remains cached; the remote include is executed per request.

If you remember only one rule for the exam, remember this.

References:
Salesforce B2C Commerce Documentation – Caching
Explains page caching, include caching, and how they interact.
Salesforce B2C Commerce Documentation – ISML <isinclude> Tag

CORRECT TEXT

There is a business requirement to allow a third-party warehouse management system to update the MySampte.com storefront product inventory in real time.The architect decided that this is most easily accomplished by using the Open Commerce API (OCAPI). The developer needs to test the OCAPI settings m their sandbox. Assume the client ID for testing is "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'. What B the correct GCAPI setting for this?


Explanation:

To allow an external Warehouse Management System (WMS) to update inventory in real-time, the developer must configure the OCAPI Data API.

Identifying the Correct Resource:
The WMS needs to modify existing records. The resource for this is:
inventory_lists/*/product_inventory_records/*
In the OCAPI settings, the developer must grant the WMS's Client ID access to this resource so it can read and update inventory data.

The PATCH Method:
Since the requirement is to update inventory, the HTTP PATCH method is the best choice.
- PATCH updates only specific fields (such as allocation or stock_level).
- PUT would replace the entire record, which is unnecessary and risky.
- POST is intended for creating new records, not updating existing ones.

Using PATCH ensures efficient, targeted updates whenever stock levels change in the physical warehouse.

Example Configuration JSON:
{
"client_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"resources": [
{
"resource_id": "/inventory_lists/*/product_inventory_records/*",
"methods": ["patch", "get"],
"read_attributes": "(**)",
"write_attributes": "(**)"
}
]
}

This configuration allows the external system to locate a product within any inventory list and update its stock levels in real time.

References:
Salesforce Developers: OCAPI Data API - Inventory Lists
B2C Commerce Infocenter: OCAPI Settings

Salesforce-B2C-Commerce-Cloud-Developer Exam Questions - Home Previous
Page 5 out of 41 Pages