Salesforce certification · Exam Salesforce-B2C-Commerce-Developer

Salesforce-B2C-Commerce-Developer Mock Exam Page 3

Salesforce B2C Commerce Developer

Free Salesforce-B2C-Commerce-Developer mock exam questions 21–30, each with the answer and an explanation.

20 questions · 30 minutes · free, no sign-up

Free Salesforce-B2C-Commerce-Developer questions

21–30 of 44 free
Question 21 Choose 1
A developer wants to embed a link to a content page from within the body of another content asset. the target content asset ID is: about-us
Which option represents the correct formatto use?
Show answerHide answer

Correct answer: A $url(''page-Show,''cid'', about-us')$

Explanation

Explanation:

In Salesforce B2C Commerce, the $url() function is used in ISML templates to generate URLs dynamically. This function is commonly used to create links to pages, content assets, or other resources within the platform. To link to a content asset, the $url() function requires specific parameters:

Action: Specifies the type of page or resource being linked to.
Parameters: Key-value pairs that provide additional context, such as the content ID (cid).

The correct syntax for linking to a content asset uses the Page-Show action, with the cid parameter specifying the content asset ID.

Option Analysis:

A. $url('Page-Show', 'cid', 'about-us')$
Action: Page-Show is the correct pipeline action used to display content assets in Salesforce B2C Commerce.
Parameters: The cid parameter is used to specify the content asset ID, which in this case is about-us. The syntax follows the standard format for the $url() function, where parameters are provided as key-value pairs.
Correctness: This option correctly formats the URL to point to the content asset with the ID about-us. The syntax is valid and adheres to the platform’s conventions.

B. $url('Content_Show', 'about-us')$
Action: Content_Show is not a valid pipeline action in Salesforce B2C Commerce for rendering content assets. The correct action is Page-Show.
Parameters: The syntax here is incorrect because it does not specify the cid parameter explicitly. The $url() function expects parameters in key-value pairs (e.g., 'cid', 'about-us'), not just a single value.
Correctness: This option is incorrect due to the invalid action and improper parameter syntax.

C. $url('Content-Page', cid 'about-us')$
Action: Content-Page is not a valid pipeline action in Salesforce B2C Commerce. The correct action is Page-Show.
Parameters: The syntax cid 'about-us' is invalid. The $url() function requires parameters to be enclosed in single quotes and provided as key-value pairs (e.g., 'cid', 'about-us'). Additionally, the semicolon and missing comma make this syntactically incorrect.
Correctness: This option is incorrect due to the invalid action and malformed syntax.

Why Option A is Correct:
The Page-Show pipeline is used to render content assets in Salesforce B2C Commerce.
The cid parameter is the standard way to specify the content asset ID (in this case, about-us).
The syntax $url('Page-Show', 'cid', 'about-us')$ follows the correct format for the $url() function, which takes the form $url('action', 'param1', 'value1', 'param2', 'value2', ...).

Reference:
Salesforce B2C Commerce Documentation: The official Salesforce B2C Commerce Developer Guide explains the use of the $url() function in ISML templates. Specifically, the Page-Show pipeline with the cid parameter is used to link to content assets. You can find details in the ISML Functions section of the Salesforce B2C Commerce Documentation (available on the Salesforce Help Portal).

Content Asset Linking: The documentation for content assets in B2C Commerce specifies that content assets are accessed using the Page-Show pipeline with the cid parameter. For example, see the Content Management section in the B2C Commerce Developer Guide.

Trailhead: Salesforce Trailhead modules, such as "B2C Commerce Content Management," provide practical examples of linking to content assets using ISML templates.
Question 22 Choose 1
A developer is using logging in scripts to troubleshoot an issue. They are using thedw.system.Log class to write to specific log levels and categories. Which log level is always enabled by default?
Show answerHide answer

Correct answer: A FATAL

Explanation

Explanation:

In Salesforce B2C Commerce (SFCC), the dw.system.Log class (accessed via Logger.getLogger() or convenience methods on Logger) is used to write messages at different log levels: FATAL, ERROR, WARN, INFO, and DEBUG. These levels follow a standard severity hierarchy where FATAL is the highest severity and DEBUG is the lowest.

A key platform behavior is that FATAL-level logging is always enabled by default across all environments, including production, staging, development, and sandboxes. This is intentional design by Salesforce to ensure that critical, system-threatening events (e.g., unrecoverable errors, severe exceptions, or fatal application failures) are always captured in the log files for debugging and monitoring purposes, even if no custom logging configuration has been applied.

Detailed behavior of log levels in SFCC:
FATAL — Always enabled and written to disk (appears in customfatal-*.log files in WebDAV). No configuration is needed to guarantee these messages are logged.
ERROR — Enabled by default in most environments, but can be disabled in custom log settings if explicitly unchecked in Business Manager → Administration → Operations → Custom Log Settings → Log Files section.
WARN — Enabled by default in production-like environments, but configurable.
INFO — Disabled by default in production for custom logs (to avoid excessive logging), but can be enabled manually.
DEBUG — Always disabled for file-based logging in production (to prevent performance impact); in non-production, it uses in-memory logging for the Request Log tool and is only written to disk if explicitly enabled.

Because FATAL messages represent the most severe issues that could indicate data corruption, security problems, or complete system failure, Salesforce ensures they are never suppressed—even if a developer has not touched the Custom Log Settings at all. This is why option A is correct.

Why not the other options?
B. INFO → INFO is not always enabled by default. In production, INFO-level messages to custom logs are disabled to prevent log file bloat (limited to 10 MB/day per server). They must be explicitly enabled via Custom Log Settings.
C. ERROR → ERROR is enabled by default in most configurations, but it is not guaranteed to be always enabled. A developer or administrator could disable ERROR logging in Custom Log Settings (though this is rare and not recommended). FATAL, however, cannot be disabled.

Best Practice Note:
When troubleshooting in scripts, developers should prefer FATAL or ERROR for critical issues that require immediate attention, WARN for recoverable problems, and INFO/DEBUG only in development/non-production for detailed tracing. Always check Custom Log Settings in Business Manager to confirm which levels are actually being written to disk.

References:
Salesforce B2C Commerce Documentation: Log Files Overview → States: "The fatal log level is always enabled on all instances."
Salesforce Help: Custom Log Settings → Confirms that FATAL messages are always written, regardless of configuration checkboxes.
SFCC Script API Reference: dw.system.Logger → Describes log levels and notes the special treatment of FATAL.
Trailhead Module: Performance Analysis and Logging in B2C Commerce – Reinforces that FATAL is the only level guaranteed to be always active.
Question 23 Choose 1
Multiple shoppers report slow performance on theProduct Details Page.
Which tool can a developer use to view average response times for the Product-Detail controller route?
Show answerHide answer

Correct answer: A Pipeline Profiler

Explanation

Explanation:

Why URL Request Analyzer Is Correct:
The URL Request Analyzer is designed specifically to:
- Measure average, minimum, and maximum response times
- Break down requests by controller route
- Analyze real storefront traffic
- Identify performance bottlenecks
It is the only tool that provides aggregated timing metrics per route, which is exactly what the question asks for.

Why the Other Options Are Incorrect:
❌ A. Pipeline Profiler
Pipeline Profiler (legacy) is not designed for aggregate performance metrics and is deprecated in SFRA.

❌ B. Request Logs
Request logs show individual request entries, not averages or trends. They are useful for debugging, not performance analysis.

Key Takeaway:
Use URL Request Analyzer to measure real-world performance metrics per controller route.

References:
URL Request Analyzer
Question 24 Choose 1
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 tag, to see if that resolves while issue. Which consideration must the developer keep in mind while deploying the hot fix in production?
Show answerHide answer

Correct answer: C The TTL cache setting only affects static content and not the page cache, which could potentially cause he production issue.

Explanation

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 , then even after you deploy the updated template, the cached version might still be served.

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 tags, the highest cache duration is used" ❌ Not accurate.
Cache scope and duration are defined per tag — it doesn’t combine or inherit from others globally.
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 does affect page cache.
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
Question 25 Choose 1
Which line of code should a developer add for custom category debug logging?
Show answerHide answer

Correct answer: C Logger.getLogger( " contact " ).debug( " Contact service responded with OK. " );

Explanation

Explanation

In Salesforce B2C Commerce (SFCC) server-side JavaScript, the correct way to obtain a logger instance for a custom category is through the Logger.getLogger() static method on the dw.system.Logger class. You pass a category name (a string) to identify the log source, then call the appropriate log-level method (.debug(), .info(), .warn(), .error(), etc.) on the returned Logger instance.

Why the Other Options Are Incorrect

A. Logger.customLogger('contact').debug("Contact service responded with OK.");
– There is no customLogger() method on the dw.system.Logger class. This method does not exist in the SFCC Script API, so this line would throw a runtime error. It is a distractor that sounds plausible but is fabricated.

B. Logger.debug('Contact service responded with OK.');
– debug() is an instance method, not a static method. You cannot call it directly on the Logger class. You must first obtain a logger instance via getLogger(), getRootLogger(), or a similar factory method. Additionally, this line does not specify any custom category, so it fails the "custom category" requirement.

Reference

Salesforce B2C Commerce Script API documentation — Logger class, specifically the getLogger(String category) static method and instance-level logging methods (debug, info, warn, error, fatal). Also see Salesforce B2C Commerce documentation on Logging and Log Center for custom log categories in Business Manager.
Question 26 Choose 1
What is the correct format to use for embedding a link to a content page?
Show answerHide answer

Correct answer: B < a href= " ${URLUtils.url( ' Page-Show ' , ' cid ' , ' about-us ' )} " > About Us < /a >

Explanation

Explanation:

In Salesforce B2C Commerce (SFCC), content assets and content pages are rendered through the Page-Show controller endpoint. The URLUtils.url() helper builds a URL to a given controller route, and you must pass the correct route name followed by the parameter name/value pairs.

Why the Other Options Are Incorrect:

A. ${URLUtils.url('Content-Show', 'about-us')}
– There is no Content-Show controller route in the SFCC reference architecture. This route name does not exist, so the URL would not resolve to a valid endpoint. It also passes the content ID as a positional argument without the required cid parameter name, which is incorrect usage.

C. ${URLUtils.url('Content-Page', 'cid', 'about-us')}
– There is no Content-Page controller route in the SFCC reference architecture. This route name is fabricated. While the parameter format ('cid', 'about-us') is correct, the route name itself is wrong, so the link would fail.

Reference:

Salesforce B2C Commerce Script API documentation — dw.web.URLUtils class, specifically the url() method. Also see the SFCC reference architecture (SFRA / SiteGenesis) controller documentation for the Page-Show route and content asset rendering.
Question 27 Choose 1
How should a developer set up the files before making required edits to the address form?
Show answerHide answer

Correct answer: B Create a new sub-folder in the forms folder. Name iten_US. Copy existingaddress.xmlfile in the new folder.

Explanation

Explanation:

In Salesforce B2C Commerce (SFCC), form definitions are XML files stored under the forms folder within a cartridge. The address form is defined in a file named address.xml. To customize a form for a specific locale, you must create a locale-specific sub-folder named after the locale (e.g., en_US) inside the forms folder, and then place a copy of the address.xml file in that sub-folder.

This allows the developer to edit the en_US/address.xml file to modify the address form specifically for the en_US locale, without affecting the default form used by other locales. SFCC automatically resolves the correct form definition based on the active locale.

Why the Other Options Are Incorrect:

A. Create a copy of existing address.xml file in the default folder. Rename that file to address_en_US.xml.
– SFCC does not use a filename-based locale suffix convention like address_en_US.xml. Locale-specific form definitions are resolved by folder structure (a locale-named sub-folder), not by renaming the file. Placing a renamed file in the default folder would not be recognized as a locale-specific override.

C. Create a new sub-folder in the xmls folder. Name it en_US. Copy existing address.xml file in the new folder.
– Form definitions are not stored in an xmls folder. They belong in the forms folder. The xmls folder is not the correct location for form definitions, so this option would not work.

Reference:

Salesforce B2C Commerce documentation <— Forms (form definitions and XML form files). Also see the SFCC reference architecture (SFRA / SiteGenesis) documentation on customizing forms and locale-specific form overrides.
Question 28 Choose 1
A developer is asked to periodically create a CSV file in a WebDAV folder to hold the orders information of the last 30 days. What are the appropriate actions to implement such a requirement?
Show answerHide answer

Correct answer: A Develop and configure a steptype and corresponding CommonJS job step script.

Explanation

Explanation

In Salesforce B2C Commerce (SFCC), scheduled batch processing — such as periodically generating a CSV file and writing it to a WebDAV folder — is implemented using the Job framework. A job is made up of one or more steps, and each step is defined by a steptype. The steptype maps to a CommonJS job step script that contains the actual logic.

Why the Other Options Are Incorrect

B. Implement and configure a recurring task using the cron command in Business Manager.
– SFCC does not provide a general-purpose "cron command" feature in Business Manager for developers to schedule arbitrary recurring tasks. Scheduling in SFCC is done through the Job framework (job schedules), not by writing cron commands. While jobs can run on a schedule (which internally uses time-based triggers), the developer does not "use the cron command" — they configure a job schedule. This option misrepresents how scheduling works in SFCC.

C. Configure a new custom OCAPI endpoint and use the Customers resource type.
– OCAPI (Open Commerce API) is a REST API for external integrations, not a mechanism for periodically generating files on the server. It also does not run on a schedule on its own, and the Customers resource type is unrelated to orders or to writing CSV files to WebDAV. This option conflates an external API integration with an internal scheduled batch job and uses the wrong resource type.

Reference

Salesforce B2C Commerce documentation — Jobs (job framework, steptypes, job step scripts, and job scheduling) and dw.io package (File, FileWriter, CSVStreamWriter) for WebDAV file operations.
Question 29 Choose 1
In the SFRA Page controller, the following route exists:
server.get( ' Include ' ,server.middleware.include,cache.applyDefaultCache,
function(req,res,next) {
...assume original code here...
next();
}
);
The result of navigating to the address below is an error page.
https://yourinstance/on/demandware.store/Sites-RefArch-Site/en_US/Page-Include?cid=about-us What is the correct way to use this controller route in an ISML template?
Show answerHide answer

Correct answer: B < isinclude url= " ${URLUtils.url( ' Page-Include ' , ' cid ' , ' about-us ' )} " >

Explanation

Explanation

In SFRA, the `Page-Include` route is a special controller endpoint designed to be used with the `` ISML tag. It is not meant to be navigated to directly in a browser (which is why visiting the URL directly produces an error page), and it is not a content page route.

The `` tag is an SFRA ISML tag that renders the output of a controller route inline within another template. It fetches the response from the given URL and embeds it into the current page. The `Page-Include` route uses `server.middleware.include` and is built specifically to serve content for this inline rendering purpose.

Why the Other Options Are Incorrect

A. `${Resource.msg('aboutus', 'content', null)}`
– This creates a hyperlink that points the shopper's browser directly to the `Page-Include` route. As the scenario states, navigating directly to this URL produces an error page. The `Page-Include` route is not designed to be a standalone navigable endpoint — it exists to be rendered inline via ``. Using an `` here reproduces the exact error described in the question.

C. ``
– There is no `` ISML tag in SFRA/SFCC. This tag does not exist, so it would fail. The correct tag for embedding a controller route's output inline is ``, not ``.

Reference

Salesforce B2C Commerce / SFRA documentation — ISML tags (``), and the SFRA Page controller (`Page-Include`, `Page-Show` routes). Also see SFRA documentation on server-side includes and the `server.middleware.include` middleware.
Question 30 Choose 1
Screen image with “Active” “Log Category” and “Log Level” along the top. Under the log category are three lines. On the first line, there is an empty log category field. To the right of this empty field is the word “Info” under the log level. On the second line, the word “root” is under the log category and to the right of that is the word “Warn” under the log level. On the third line, a checked box is under “Active” with “myLogCategory” under the “log category” and to the right of that is the word “Info” under the log level. Beneath this information is the header “Custom Log Targets. Under this header is an empty space for an email with the Text “Messages with log level FATAL can be sent to email recipients” Below this is a list of log file to select log levels written to files. The following love levels are selected: “Fatal”, “Error”, and “Warn” and the following log levels are not checked: “Info” and “Debug” The developer wants to be able to view DEBUG level messages for myLogCategory in the Request Log tool. Given the custom log configurations in the image above, what does the developer need to do to accomplish this?
Show answerHide answer

Correct answer: A Change the Log Level for myLogCategory to DEBUG.

Explanation

Explanation

In Salesforce B2C Commerce (SFCC), log configuration in Business Manager (Administration > Site Development > Development Setup > Log Settings) has two distinct parts:

1. Log Category configuration (the top table with "Active", "Log Category", and "Log Level") — This defines, per custom log category, the threshold log level at which messages are captured. Each category (including `myLogCategory`) has its own log level. The root category also has a level. A message is only logged for a given category if its level is at or above that category's configured level.

2. Log Files / Custom Log Targets (the bottom section with checkboxes for Fatal, Error, Warn, Info, Debug) — This defines which log levels get written to the log files on disk (and thus which are available for tools that read the log files, such as the Request Log tool).

Why the Other Options Are Incorrect

B. Check the DEBUG box in the Log Files section.
– Checking the DEBUG box in the Log Files section only affects whether DEBUG-level messages (that are already being generated) get written to the log files. It does not cause DEBUG messages for `myLogCategory` to be generated in the first place. Since `myLogCategory` is set to Info, its DEBUG messages are filtered out before they ever reach the file-writing stage. So checking the DEBUG box alone would not produce any DEBUG messages for `myLogCategory`. This option addresses the wrong layer of the configuration.

C. Change the Log Level for myLogCategory to DEBUG and check the DEBUG box in the Log Files section.
– While this combination would be the most complete configuration in some scenarios (ensuring both generation and file output of DEBUG messages), the question asks what the developer needs to do given the configuration shown. The critical change is setting the category level to DEBUG. Option C overstates the requirement by bundling in the Log Files checkbox as a necessity, making it a less precise answer than A. The category-level change (A) is the correct, targeted fix.

Reference

Salesforce B2C Commerce documentation — Log Settings in Business Manager (Administration > Site Development > Development Setup > Log Settings), including Log Categories, Log Levels, Custom Log Targets, and the Request Log tool. Also see SFCC documentation on the `dw.system.Logger` API and log level filtering behavior.
Full mock exam

Sit the Salesforce-B2C-Commerce-Developer exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real Salesforce-B2C-Commerce-Developer exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full Salesforce-B2C-Commerce-Developer mock exam
  • —questions per mock
  • —time limit
  • 154questions in the bank
  • Newmock on every attempt