Salesforce-B2C-Commerce-Cloud-Developer Practice Test
Updated On 1-Jan-2026
202 Questions
A developer observed a specific issue in production, which they cannot reproduce in other
environments. The developer wants todo a hot fix to one of the ISMLpages, which uses
A. It will be required to invalidate the cache for the hot fix.
B. If the page has multipletags, the highest cache duration will be used in production to determine the resulting page's caching behavior.
C. The TTL cache setting only affects static content and not the page cache, which could potentially cause he production issue.
Explanation:
When deploying a hotfix to an ISML page in Salesforce B2C Commerce (SFCC), especially one that uses the < iscache > tag, you must consider the page caching mechanism.
If a page is cached (either fully or partially), any changes you make to the ISML file won’t take effect immediately in production unless you invalidate the cache.
🔍 Why Option A is Correct:
"It will be required to invalidate the cache for the hot fix."
✅ True
SFCC caches pages and templates aggressively in production for performance.
If the ISML page is cached using
You must either:
Manually invalidate the page cache via Business Manager or
Deploy with a code version change and trigger automatic cache invalidation
➡️ Failing to invalidate cache means your hotfix won’t be reflected immediately, making troubleshooting ineffective.
❌ Why the Other Options Are Incorrect:
B. "If the page has multiple
Cache scope and duration are defined per
The final caching behavior depends on the outermost scope or how the template is included.
C. "TTL only affects static content, not the page cache" ❌
Misleading.
TTL (Time-To-Live) defined in
It's used to determine how long a rendered template stays in the cache before expiring.
So yes, it can absolutely affect dynamic ISML behavior, which may be the root cause of the issue.
📘 Reference:
ISML < iscache > Tag Documentation
Cache Invalidation Guide
A developer needs to render a Page Designer page in JSON format. What is the correct syntax?
A. PageMgr.serializePage(pageID), {parameter1:value1}};
B. JSON.stringgify(PageMgrrenderpage(pageID), {paramter1:value1}}:
C. PageMgr,renderPage{pageID, {parameter1: value1}}
Explanation:
Key Requirement:
Render a Page Designer page in JSON format (e.g., for headless commerce or API responses).
Why Option C?
✅ Correct Syntax for PageMgr.renderPage
The PageMgr.renderPage() method is used to render Page Designer pages programmatically.
To output in JSON, set the renderMode parameter to json:
PageMgr.renderPage(pageID, {
renderMode: 'json',
parameter1: value1 // Additional parameters if needed
});
How It Works:
Returns the page structure (regions, components, and data) as JSON.
Used in controllers or scripts to integrate with headless frontends.
Why Not Other Options?
❌ A. PageMgr.serializePage()
Does not exist in the B2C Commerce API.
❌ B. JSON.stringify(PageMgr.renderPage())
Incorrect: renderPage() already returns JSON when renderMode: 'json' is set. Wrapping it in JSON.stringify is redundant.
Reference:
Salesforce Docs:
PageMgr.renderPage()
Page Designer JSON Output
A client has a requirement to allow users on the Storefront to filter by a newly created
attribute.
After creating the search refinement, what else is necessary to achieve this?
A. Ensurethe attribute has data and is indexed
B. Set the attribute as Searchable.
C. Change the productsearchrefinebar.isml template.
Explanation:
After creating a search refinement definition (to allow filtering by a new product attribute on the Storefront), you must ensure that:
The attribute contains actual data in the product catalog
The attribute is indexed in the search index
This makes it available to be used for refinements (faceted search) on the storefront
Even if you create the refinement configuration in Business Manager, it won’t work unless the attribute is indexed and populated.
🔧 Steps to Achieve Filtering on a New Attribute:
✅ Create the attribute in the product system object (if not already present).
✅ Populate the attribute with values for the appropriate products.
✅ Configure it as searchable and refinable in Business Manager:
Go to Merchant Tools → Search → Searchable Attributes
Set:
Searchable = true (if you want to search by it)
Use in Search Refinements = true (to enable filter)
✅ Rebuild the search index so the changes take effect.
✅ Verify in storefront: You should see the new refinement appear in the product listing page sidebar.
❌ Why the Other Options Are Incorrect:
B. Set the attribute as Searchable
This is necessary only if you want the attribute to be searchable, but not sufficient alone to make it refinable. Also, indexing is still required.
C. Change productsearchrefinebar.isml
The SFRA template already supports dynamic refinements. You don’t need to change the ISML unless you’re customizing layout or display.
📘 Reference:
Searchable Attributes & Refinements
Indexing Product Attributes for Search
A developer uses hooks for an extension point. Which n true for running multiple hooks for an extension point?
A. It is possible to register multiple modules to call for an extension point in a singlehooks.json file
B. It is possible to control the order in which registered modules are called.
C. If you call multiple modules, only the first hook called returns avalue
Explanation:
In Salesforce B2C Commerce, when using hooks for an extension point, A is true: multiple modules can be registered to call for an extension point in a single hooks.json file. This allows different cartridges to contribute to the same extension point. However, the order of execution is not guaranteed or controllable (B is false), and all registered hooks can return values unless overridden, so only the first hook returning a value is not inherently true (C is false).
Reasoning:
A. It is possible to register multiple modules to call for an extension point in a single hooks.json file.
True. In B2C Commerce, the hooks.json file in a cartridge (e.g., cartridge/scripts/hooks.json) can define multiple entries for the same extension point.
For example:
{
"hooks": [
{
"name": "dw.order.calculateTax",
"script": "custom/taxCalc1"
},
{
"name": "dw.order.calculateTax",
"script": "custom/taxCalc2"
}
]
}
This registers taxCalc1 and taxCalc2 to handle the dw.order.calculateTax extension point, allowing multiple modules to contribute.
B. It is possible to control the order in which registered modules are called.
False. The order of hook execution is not deterministic and depends on the cartridge path and registration order in hooks.json. B2C Commerce does not provide a built-in mechanism to enforce or control the sequence of hook calls for the same extension point. Hooks are executed in the order they are encountered, but this is not guaranteed or configurable.
C. If you call multiple modules, only the first hook called returns a value.
False. When multiple hooks are registered for an extension point, all hooks are called, and each can return a value. The dw.system.HookMgr.callHook() method aggregates the results (e.g., into an array), and the calling code can process all returned values. The first hook’s return value does not inherently override others unless the implementation is designed to stop processing after the first non-null result (which is not a default behavior).
Implementation Note:
To use multiple hooks, ensure each module (e.g., taxCalc1.js, taxCalc2.js) exports the required function:
// custom/taxCalc1.js
module.exports = {
calculateTax: function (basket) {
return { tax: 10 }; // Example return value
}
};
// custom/taxCalc2.js
module.exports = {
calculateTax: function (basket) {
return { tax: 5 }; // Additional return value
}
};
Calling dw.system.HookMgr.callHook('dw.order.calculateTax', 'calculateTax', [basket]) will return an array of results (e.g., [{tax: 10}, {tax: 5}]), allowing the calling code to handle multiple outputs.
Reference:
Salesforce B2C Commerce Documentation: Hook Manager details multiple hook registrations and result aggregation.
Trailhead Module: “B2C Commerce Developer” module on “Customizing Business Logic” covers hook usage.
Exam Tip:
For the Salesforce B2C-Commerce-Developer exam, understand that hooks.json supports multiple registrations for an extension point, but the order is not controllable, and all hooks can contribute values. Be cautious of options suggesting strict ordering or single-value returns, as these misrepresent hook behavior.
A developer is tasked with the development of anew Page Designer Page Type, as
requested by themerchant.
How should they define therendering logic of the page?
A. Implement a JavaScript file with a render () function.
B. Implement a metadata JSON file with a ''render'' property.
C. Implement a Controller file with a ''render'' route.
Explanation:
When creating a new Page Designer Page Type in Salesforce B2C Commerce, one of the key tasks is to define how the page should render on the storefront. This is done by providing rendering logic in the form of a JavaScript module that includes a render() function.
🔧 How It Works:
The rendering logic is specified in a JavaScript file, usually placed in:
/cartridge/scripts/render/pageTypeName.js
The file must export a render() function, which is automatically called by Page Designer when the page is rendered.
🧩 Example:
'use strict';
function render(contextObject) {
var template = 'pages/pageTypeTemplate';
return {
template: template,
context: contextObject
};
}
module.exports.render = render;
This render() function tells Page Designer which ISML template to use and provides the context data for rendering.
📁 Page Type Metadata Example (for reference):
In the Page Type JSON metadata, you reference the rendering module:
{
"page_type_id": "custom-page-type",
"name": "Custom Page Type",
"description": "My custom page type",
"template": "default",
"render_template": "app_custom/cartridge/scripts/render/customPageType.js"
}
❌ Why the Other Options Are Incorrect:
B. Metadata JSON with a render property
❌ The metadata JSON defines structure, not render logic. It points to the rendering JS file but doesn’t contain the logic itself.
C. Controller with a render route
❌ Page Designer does not rely on custom controllers for rendering. It uses the render module internally within its framework.
📘 Reference:
Page Designer Developer Guide
Rendering Logic – Page Designer
| Salesforce-B2C-Commerce-Cloud-Developer Exam Questions - Home | Previous |
| Page 7 out of 41 Pages |