Total 202 Questions
Last Updated On : 20-Feb-2026
Given the following snippet:
• Server.append( ‘Show’ , function (req, res, next) )
According to SFRA, which two options shows a correct way to complete the code above in order to provide
data to the response using a controller?
Choose 2 answers
A. res.viewData = {
data: myDataObject
};
res.render(‘/content/myPage’);
next();
});
B. res.setViewData ({
data: myDataObject
});
res.render(‘/content/myPage’);
next();
});
C. res.render(‘/content/myPage’,{
data: myDataObject
});
next();
});
D. res.render(‘/content/myPage’);
next();
}).append{(
Data:myDataObject
});
Explanation:
Why the Answers Are Right
B. res.setViewData({...}) + res.render(...)
This is the most SFRA-correct way to provide data to a view when you are working inside a controller route (including an appended middleware step). In SFRA, controllers often run as a chain of middleware functions, where each middleware can contribute to the final response. Salesforce explicitly provides res.getViewData() and res.setViewData() for this purpose: you update the response’s viewData object, and then render the template using res.render(). Salesforce’s SFRA customization guidance describes server.append as a way to add middleware that “adds properties to the viewData object for rendering,” and it documents res.setViewData as the method that “updates the viewData object used for rendering the template.”
Using res.setViewData() is scalable and safe because it merges data into the existing viewData rather than clobbering it, which is especially important when using server.append() (where the base route runs first, then your appended middleware runs). This pattern is designed for extension and avoids accidentally overwriting data that the base controller already put into viewData.
C. res.render(view, {...})
This option is also correct because SFRA’s res.render() supports passing a data object as a second argument. That object becomes the data context for the rendered ISML template. You’ll see this explained in SFRA learning materials and examples: the controller prepares a “properties” object and passes it into res.render, then calls next() to continue/finish the middleware chain.
While setViewData is generally preferred for extensibility (especially in appended/prepended middleware chains), passing the object directly to res.render() is still a valid SFRA approach for providing template data—particularly in simple routes.
Why the Other Options Are Incorrect
A. Directly assigning res.viewData = {...}
This is a common trap because it resembles patterns developers may have seen elsewhere, but SFRA’s documented approach is to use res.setViewData() to update view data. Salesforce’s SFRA customization documentation explicitly calls out res.setViewData and res.getViewData as the supported API for working with view data.
Direct assignment to res.viewData is risky in SFRA because:
It can overwrite existing viewData created earlier in the route chain.
It bypasses the intended middleware-friendly mechanism.
It’s not the documented best practice for SFRA extension and can make controller extensions fragile.
In exam terms: if you see res.setViewData as an option, that’s the one Salesforce wants you to recognize as the “SFRA way.”
D. Invalid / nonsensical chaining
This option is syntactically incorrect and conceptually wrong. It tries to call .append after the route has already been closed, and the object syntax shown is not valid JavaScript for SFRA route composition. SFRA route extension is done by calling server.append('RouteName', function...) (or prepend/replace), not by chaining an .append{(...)} block after the route closure.
References
Salesforce Developer Docs — Customize SFRA (Controllers/Routes, server.append, res.getViewData, res.setViewData)
Salesforce Developer Docs — SFRA Features and Components (ViewData extension concept)
SFRA learning example discussing passing an object into res.render()
In order to build the SFRA code to a developer sandbox for the first time, which build steps should the developer perform for the site to appear and function as designed?
A. npm run compile:js, npm run compile:html, npm run clean
B. npm run compile:scss, npm run compile:html, npm run clean
C. npm run compile:js, npm run compile: scss, npm run compile:html
D. npm run compile:js, npm run compile:scss, npm run compile:fonts
Explanation:
When setting up SFRA (Storefront Reference Architecture) for the first time in a developer sandbox, the site must be compiled so that all assets (JavaScript, SCSS, and HTML templates) are properly transformed and ready for deployment. SFRA uses a build pipeline based on Node.js and npm scripts to handle this compilation process.
Why Option C is Correct
The three essential build steps are:
npm run compile:js
This step transpiles and bundles JavaScript files.
SFRA uses ES6+ syntax, and this command ensures compatibility with the sandbox environment by compiling the code into browser-ready JavaScript.
npm run compile:scss
SCSS (Sass) is used for styling in SFRA.
This step compiles SCSS into CSS, ensuring that stylesheets are properly generated and linked to storefront pages.
npm run compile:html
This step processes ISML templates and other HTML-related files.
It ensures that templates are compiled and ready to be rendered by the server.
Together, these three steps guarantee that the storefront appears and functions as designed. Without compiling all three, the site would either lack functionality (missing JS), styling (missing CSS), or proper templates (missing HTML).
❌ Why the Other Options Are Incorrect
A. npm run compile:js, npm run compile:html, npm run clean
Missing SCSS compilation, so stylesheets would not be generated.
npm run clean is not required for initial build; it is used to clear old build artifacts.
B. npm run compile:scss, npm run compile:html, npm run clean
Missing JavaScript compilation, so storefront functionality would break.
D. npm run compile:js, npm run compile:scss, npm run compile:fonts
Fonts compilation is not part of the standard SFRA build process.
Missing HTML compilation, so templates would not be processed.
📘 Reference
Salesforce B2C Commerce SFRA Developer Guide – Build Process:
“To prepare SFRA for deployment, developers must compile JavaScript, SCSS, and HTML templates using npm scripts.”
Salesforce SFRA GitHub Repository
A developer has a specification to integrate with a REST API for retrieving traffic conditions. The service
expects parameters to be form encoded.
Which service type should the developer register?
A. HTML Form
B. SOAP Form
C. POST Form
D. HTTP Form
Explanation:
When integrating with REST APIs that expect form-encoded parameters (application/x-www-form-urlencoded), B2C Commerce provides the HTTP Form service type specifically for this purpose. This service type is configured in Business Manager under Administration > Operations > Services and handles:
Automatic parameter encoding: Converts JavaScript objects to key=value&key2=value2 format
Proper headers: Sets Content-Type: application/x-www-form-urlencoded
Character encoding: Properly URL-encodes special characters
Request formatting: Structures the request body according to form encoding standards
For traffic condition APIs (or similar REST services using form encoding), HTTP Form is the correct choice because:
It's designed for REST APIs (unlike SOAP services)
It handles form encoding automatically (unlike generic HTTP services)
It's configurable with timeouts and retries
It integrates with B2C Commerce's service framework for monitoring and logging
Why Other Options Are Incorrect
Option A (HTML Form) – Doesn't exist as a B2C Commerce service type. HTML forms are client-side constructs, not server-to-server service types.
Option B (SOAP Form) – Contradictory; SOAP uses XML envelopes, not form encoding. SOAP services in B2C Commerce use the "SOAP" service type, not "SOAP Form."
Option C (POST Form) – Not a valid service type. HTTP methods (GET, POST, PUT, etc.) are specified within service configurations, not as service types themselves.
References
B2C Commerce Services Guide: "HTTP Form Service Configuration"
REST Integration Documentation: "Form-Encoded API Calls"
Service Framework Reference: "Available Service Types"
Business Manager: "Registering External Services"
A merchant requires that an existing section of the Site become editable from the Business Manager, so
that they can modify it independently of the developer.
Which of these is an important factor for a developer to consider when choosing the appropriate solution
between a content slot and a Page Designer component?
A. Only Page Designer Components can be localized for different languages.
B. Only content slot configurations can be tied to campaigns.
C. Only page Designer components can ve tied to campaigns.
D. Only content slot configurations can ve localized for different languages
Explanation:
Both Content Slots and Page Designer allow merchants to manage content, but they serve different architectural purposes. A critical distinction is their relationship with the B2C Commerce Online Marketing Suite.
Content Slots are deeply integrated with Campaigns and A/B Testing. A merchant can create a "Slot Configuration" that is only visible to a specific "Qualifying Customer Group" or during a specific "Promotion." This allows for highly targeted marketing. While Page Designer is more flexible for layout creation, it does not currently have the same native, granular integration with the Campaign engine to swap components based on marketing qualifications in the same way a slot can.
Why the Incorrect Answers are Wrong
A and D – Both Content Slots and Page Designer components can be localized. Content assets inside slots can be translated, and Page Designer attribute definitions support the localizable: true property.
C – This is the opposite of the truth. Content slots are the primary tool for campaign-driven content. While Page Designer has "visibility" settings, the campaign-slot relationship is a core differentiator in B2C Commerce architecture.
References
Salesforce Help: Comparison of Content Slots and Page Designer
Infocenter: Campaigns and Promotions
A developer is asked to write a log containing the ID and name of the product with a variable named myProduct. Which snippet of code should be used?
A. Logger.warn(‘The current producto is {0} with name {1}’, myProduct.getID(), myProduct.getName());
B. Logger.warn(‘The current producto is {0} with name {1}’), context(myProduct.getID(),
myProduct.getName());
C. Logger.warn(‘The current producto is ${myProduct.getID()} with name ${myProduct.getName()}’);
D. Logger.warn(‘The current producto is %s with name %s’), context(myProduct.getID(),
myProduct.getName());
Explanation:
Why "A" is Correct
The dw.system.Logger class in B2C Commerce Script (Rhino/V8) uses a specific message formatting syntax.
Placeholder Syntax: The method Logger.warn(message, ...args) uses curly-brace placeholders like {0}, {1}, etc.
Parameter Mapping: The arguments provided after the string (in this case, myProduct.getID() and myProduct.getName()) are injected into those placeholders in order.
Option A correctly uses the {0} and {1} placeholders and passes the product ID and Name as subsequent arguments to the warn function.
Why Other Options are Incorrect
B & D: These use a non-existent context() function. This is likely a distractor based on other programming languages or logging frameworks, but it is not part of the B2C Commerce dw.system.Logger API.
C: This uses Template Literals (${...}). While modern B2C Commerce (V8 engine) supports template literals, this specific exam question usually tests the traditional Logger method parameterization. Furthermore, if you use a template literal, the string is evaluated before it reaches the logger, which is less efficient than letting the logger handle the substitution (especially if the log level is disabled). However, in the context of this specific multiple-choice set, A is the "official" B2C-prescribed way to use the Logger's built-in formatter.
References
Salesforce Developers: Logger Class - warn method
Salesforce Help: Troubleshooting with Custom Logs
A developer wants to create in Business Manager extension with the cartridge named
plugin_vm_extension.
Which two steps should the developer take for the extension option to show up in Business Manager?Choose 2 answers
A. Add plugin_bm_extension to the cartridge path under business manager cartridge site
B. Add the appropiate roles and permission to the user to view the business manager extension.
C. Add plugin_bm_extension to the cartridge path under Storefront cartridge site path.
D. Activate a new code version for the Business Manager Site.
Explanation:
Why the Answers Are Right
A. Add plugin_bm_extension to the Business Manager cartridge path
In Salesforce B2C Commerce, Business Manager (BM) runs on its own site context (commonly the Business Manager site), which has a separate cartridge path from the storefront site. For a Business Manager extension to appear (for example, custom menus, modules, or UI screens), the extension cartridge must be included in the Business Manager cartridge path.
Key points:
BM extensions are not loaded from the storefront cartridge path.
The platform only scans the BM cartridge path to discover BM-specific resources (e.g., bm_extensions, menus, pipelines/controllers for BM).
If the cartridge is not present in the BM path, the extension cannot be discovered, regardless of correct code or permissions.
This is a foundational configuration step and a common exam check: BM functionality lives in the BM cartridge path, not the storefront path.
D. Activate a new code version for the Business Manager Site
Even after adding the cartridge to the BM cartridge path, the extension will not become visible until a new code version is activated for the Business Manager site. B2C Commerce loads code only from the active code version. Any change—adding cartridges, modifying BM resources, or updating configuration—requires activation to take effect.
Why this matters:
Code uploads alone do not change runtime behavior.
Activation is what instructs the platform to reload cartridges and BM metadata.
Without activation, Business Manager continues to run the previous code version, and the extension remains hidden.
From an exam perspective, this is a classic pitfall: configuration changes + no activation = no effect.
Why the Other Options Are Incorrect
❌ B. Add appropriate roles and permissions to the user
Roles and permissions control who can see or use an extension after it exists. They do not make the extension appear in the first place. If the cartridge isn’t loaded (wrong path or inactive code version), no amount of user permissions will surface it. Permissions are necessary after discovery—not for discovery.
❌ C. Add the cartridge to the Storefront cartridge site path
This is incorrect because storefront cartridges and Business Manager cartridges are isolated. Adding a BM extension cartridge to the storefront path:
Does not load BM UI resources
Does not register BM menus or modules
Has no effect on Business Manager visibility
This option is a frequent exam distractor designed to test understanding of site separation between Storefront and Business Manager.
Exam Tip
For the Salesforce Certified B2C Commerce Cloud Developer (Comm-Dev-101) exam, remember this rule:
Business Manager extension visibility requires:
Cartridge in the BM cartridge path, and
An activated code version.
Permissions come after the extension is loaded.
References
Salesforce B2C Commerce Documentation — Business Manager Extensions
Trailhead: Extend Business Manager
A Storefront is designed so that multiple pages share a common header and footer layout.
Which ISML tag should a developer use on the templates for these pages to avoid code repetition in the most effective way
A. < isdecorate > …< / isdecorate >
B. < iscontent > … < / iscontent >
C. < isreplace > … < / isreplace >
D. < isinclude > … < / isinclude >
Explanation:
The <isdecorate> tag is the standard B2C Commerce solution for Template Decoration (also known as a Master Page or Wrapper pattern).
Instead of copying the header and footer code into every page template, you create one "decorator" template (e.g., pt_storefront.isml) that contains the common layout. Every other page template then "wraps" its unique content inside an <isdecorate template="path/to/decorator"> tag. When the page renders, the platform inserts the content from the page into the decorator's <isreplace/> tag. This ensures that a change to the header or footer only needs to be made in one file, satisfying the requirement to avoid code repetition effectively.
Why the Incorrect Answers are Wrong
B. iscontent: This tag is used to set the MIME type (e.g., text/html) and caching of the page. It does not handle layout sharing.
C. isreplace: This tag is used inside the decorator template to mark the spot where the content should be injected. It is not used on the "pages" themselves to share the layout.
D. isinclude: While <isinclude> can be used to bring in a header or footer, it is less effective for full-page layout management. Using isdecorate allows the layout to "own" the structure, making it much easier to manage complex nested layouts.
References
Salesforce Developers: ISML isdecorate Element
Template Composition with ISML
A client wants to differentiate their monobrand stores with a special icon when shown in the store locator. The information is saved in a true/false custom attribute for each Store object in Merchant tools. How should the developer follow SFRA best practices to expose this data for rendering?
A. Extend the existing Stores_Find controller with a new middleware function that performs the query
B. Pass the Store system object to the template, so that custom propierties are available
C. Ad dan < isscript > to the template, and call StoreMgr.searchStoresByCoordinates();< / isscript >
D. Use the module.superModule functionality and the call method to add a new property to the Store Model.
Explanation:
This question is fundamentally about SFRA architecture and best practices, not just about getting data onto a page. The key phrases are:
“follow SFRA best practices”
“expose this data for rendering”
“custom attribute on the Store object”
In SFRA (Storefront Reference Architecture), Salesforce enforces a strict separation of concerns:
Controllers orchestrate flow and invoke models
Models shape and prepare data for the view
Templates (ISML) render data only (no business logic)
System objects should never be passed directly to templates
Why extending the Store Model is the correct approach
SFRA provides model extensibility through module.superModule, which allows developers to safely extend existing models without breaking core functionality or upgrade paths.
The Store Locator in SFRA already uses a Store Model to represent store data in the storefront. To expose a new custom attribute (for example, custom.isMonobrand) for rendering, the correct approach is:
Extend the existing Store Model
Call the base implementation using module.superModule
Add a new property derived from the Store system object’s custom attribute
Return the enhanced model to the controller and template
This approach:
Preserves SFRA’s layered architecture
Ensures templates receive clean, presentation-ready data
Avoids leaking system objects into the view
Is upgrade-safe and maintainable
From an exam perspective, this is exactly what Salesforce wants you to recognize:
👉 Data shaping belongs in models, not controllers or templates.
Why the Other Options Are Incorrect
❌ A. Extend the existing Stores_Find controller with a new middleware function
While extending controllers using server.append() is allowed in SFRA, this is not the correct place to shape or expose new data properties.
Problems with this approach:
Business logic starts leaking into controllers
Data preparation becomes duplicated or inconsistent
It violates SFRA’s model-driven design
Controllers should delegate data preparation to models, not perform it themselves. Salesforce exam questions frequently penalize controller-heavy solutions when a model-based solution exists.
❌ B. Pass the Store system object directly to the template
This option violates one of the most important SFRA rules:
❌ Never pass system objects directly to ISML templates
Why this is wrong:
Templates become tightly coupled to system APIs
It exposes unnecessary data and methods
It breaks encapsulation
It increases security and maintenance risks
SFRA templates are designed to work with plain JavaScript objects (models), not dw.catalog.Store system objects. This option is a classic exam trap.
❌ C. Add an <isscript> tag and call StoreMgr.searchStoresByCoordinates() in ISML
This is the worst possible option from an SFRA perspective.
Why this is incorrect:
ISML should never perform database queries
<isscript> logic is strongly discouraged
It violates separation of concerns
It introduces performance and security risks
Salesforce explicitly advises that templates should only render data, not fetch or compute it. Any option suggesting queries inside ISML is immediately wrong in an exam context.
References
Salesforce B2C Commerce Documentation — SFRA Models and Architecture
Salesforce B2C Commerce Documentation — Store Locator (SFRA)
A Digital Developer extends a system object, Product, and adds a Boolean attribute, “sellable,” to it. Assuming “prod” is the variable name handling the product, what code can the Developer use to access it?
A. prod.extended.sellable
B. prod.sellable
C. prod.persistable.sellable
D. prod.custom.sellable
Explanation:
Overview of Custom Attributes in Salesforce B2C Commerce Cloud
In Salesforce B2C Commerce Cloud (SFCC), system objects such as Product (dw.catalog.Product), Customer, Order, Store, etc., can be extended with custom attributes through the Business Manager. These custom attributes are defined in Merchant Tools > Site Development > Custom Object Types (for object-specific extensions) or Administration > Global Preferences > Custom Attributes (for site-wide). For the Product object, you can add attributes like Boolean, String, Integer, Date, etc., to store merchant-specific data without modifying the core schema.
When a Boolean attribute named sellable is added to the Product object type:
It becomes part of the product's custom attributes collection.
SFCC stores all custom attributes in a dedicated map accessible via the .custom property on the system object instance.
This design keeps core properties (e.g., prod.ID, prod.name, prod.online, prod.price) separate from merchant-defined ones, improving maintainability, upgrade safety, and performance.
Why prod.custom.sellable Is the Correct Way to Access It
The standard and only supported way to read or write a custom attribute on a system object is through the .custom accessor:
.custom is a dynamic property (of type dw.object.CustomAttributes) that acts like a JavaScript object/map.
Keys match exactly the attribute ID defined in Business Manager (case-sensitive, here "sellable").
For Boolean attributes, the value is a native JavaScript Boolean (true/false).
This works in controllers, pipelines, jobs, templates (via ${prod.custom.sellable}), and anywhere you have a Product instance.
This pattern is consistent across all extensible system objects in SFCC:
customer.custom.myLoyaltyPoints
order.custom.giftMessage
product.custom.sellable
Using .custom is the only officially documented and supported method. It ensures compatibility during platform upgrades and avoids accessing internal/private properties.
Why the Other Options Are Incorrect
A. prod.extended.sellable
Incorrect — There is no .extended property on Product or any system object in SFCC. This might be confused with other platforms (e.g., extended types in some Java frameworks), but it does not exist here.
B. prod.sellable
Incorrect — Direct property access like prod.sellable only works for core/platform attributes (e.g., prod.ID, prod.name, prod.onlineFlag, prod.searchable). Custom attributes are never promoted to top-level properties on the object. Attempting prod.sellable will return undefined (or throw if strict mode is enabled).
C. prod.persistable.sellable
Incorrect — There is no .persistable property on Product. This may confuse with persistence layers or Hibernate-style ORM concepts (where persistable might refer to entity state), but SFCC does not expose such a property. The internal persistence is abstracted away.
Best Practices and Additional Notes
Always check for existence if the attribute is optional:
if (prod.custom && prod.custom.sellable === true) { … } to avoid null/undefined errors.
In ISML templates: Use
For writing: prod.custom.sellable = true; (requires the object to be writable, e.g., in a transaction or job).
Custom attributes are replicated across instances and included in imports/exports.
This is a foundational concept tested heavily in the B2C Commerce Developer certification (Scripting and Data Model sections), as misuse of custom attribute access is a common real-world error.
References
B2C Commerce Developer Guide: Custom Attributes
Documentation: Working with Custom Object Types and Attributes
Which two items are appropriate content of custom logs implemented at checkout?
Choose 2 answers:
A. Customer’s password at post-checkout sign up
B. Order failure information
C. Transaction’s credit card information
D. Payment gateway service response code
Explanation:
When implementing logging for checkout, developers must balance the need for debugging with security and PCI compliance.
B (Order failure info): Logging why an order failed (e.g., "Out of stock," "Price mismatch") is essential for customer service and troubleshooting.
D (Service response codes): Logging the response code from a payment gateway (e.g., DECLINE, CVV_FAILURE) is critical to understanding why transactions are failing without needing to see the customer's private data.
Why the Incorrect Answers are Wrong
A. Customer’s password: This is a major security violation. Passwords should never be stored in plain text, and they should never be written to log files.
C. Transaction’s credit card information: Logging Credit Card numbers (PAN), CVV, or Expiry dates is a direct violation of PCI-DSS (Payment Card Industry Data Security Standard). This can lead to heavy fines and security breaches. B2C Commerce has "Log Masking" features specifically to prevent this, but the developer must never attempt to log it manually.
References
Salesforce B2C Commerce: Security and PCI Compliance
Best Practices for Logging Sensitive Data
| Page 7 out of 21 Pages |
| 45678910 |
| Salesforce-B2C-Commerce-Cloud-Developer Practice Test Home |
Our new timed Salesforce-B2C-Commerce-Cloud-Developer practice test mirrors the exact format, number of questions, and time limit of the official exam.
The #1 challenge isn't just knowing the material; it's managing the clock. Our new simulation builds your speed and stamina.
You've studied the concepts. You've learned the material. But are you truly prepared for the pressure of the real Salesforce Certified B2C Commerce Cloud Developer - Comm-Dev-101 exam?
We've launched a brand-new, timed Salesforce-B2C-Commerce-Cloud-Developer practice exam that perfectly mirrors the official exam:
✅ Same Number of Questions
✅ Same Time Limit
✅ Same Exam Feel
✅ Unique Exam Every Time
This isn't just another Salesforce-B2C-Commerce-Cloud-Developer practice questions bank. It's your ultimate preparation engine.
Enroll now and gain the unbeatable advantage of: