Salesforce certification · Exam Salesforce-B2C-Commerce-Developer

Salesforce-B2C-Commerce-Developer Mock Exam Page 2

Salesforce B2C Commerce Developer

Free Salesforce-B2C-Commerce-Developer questions on Application Development, each with the answer and an explanation.

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

Application Development questions

11–15 of 15 free
Question 11 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 12 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.
Question 13 Choose 1
Which method is efficient and scalable because it uses the product search index rather than searching the database?
Show answerHide answer

Correct answer: C ProductSearchModel().getProductSearchHits()

Explanation

Explanation

In Salesforce B2C Commerce (SFCC), the `ProductSearchModel` class (from the `dw.catalog` package) is designed to execute product searches against the product search index rather than querying the database directly. The search index is a pre-built, optimized data structure that enables fast, scalable, and efficient retrieval of product results — especially for large catalogs.

Why the Other Options Are Incorrect

A. `ProductAvailabilityModel.isOrderable()`
– `ProductAvailabilityModel` (from `dw.catalog`) is used to determine product availability and orderability (e.g., whether a product is in stock and can be ordered). It does not perform product searches, and it does not use the search index for searching. It is an availability/inventory model, not a search mechanism. While it may consult inventory data, it is not the efficient, scalable search-index-based method the question describes.

B. `ProductIndexModel.getOrderableProductsOnly()`
– There is no `ProductIndexModel` class with a `getOrderableProductsOnly()` method in the SFCC Script API. This is a fabricated distractor. `ProductIndexModel` is not a real SFCC class, and the method name does not exist. It may sound plausible because it combines "Index" and "Orderable," but it is not valid.

Reference

Salesforce B2C Commerce Script API documentation — `dw.catalog.ProductSearchModel` class, specifically the `getProductSearchHits()` method and its use of the product search index. Also see `dw.catalog.ProductAvailabilityModel` for availability/orderability (unrelated to searching) and SFCC documentation on the distinction between search-index-based and database-based product retrieval.
Question 14 Choose 1
What is the expected outcome when the log reaches the file size limit?
Show answerHide answer

Correct answer: B The current log file is archived and a new log file is created.

Explanation

Explanation:

In Salesforce B2C Commerce (SFCC), log files are subject to a configured maximum file size limit. When a log file reaches that size limit, SFCC performs log rotation: the current log file is archived (renamed/rolled over into an archive file), and a new, empty log file is created to continue capturing log messages.

Why the Other Options Are Incorrect:

A. Logging is suspended for the day.
– SFCC does not suspend logging when a file size limit is reached. Logging continues seamlessly; the system rotates the file and keeps writing to a new one. Suspending logging would cause loss of diagnostic data and is not how SFCC behaves.

C. The log file is deleted and a new log file is created.
– SFCC does not delete the existing log file when the size limit is reached. Instead, it archives (preserves) the current file and starts a new one. Deleting the log file would destroy valuable historical log data, which contradicts SFCC's log retention design.

Reference:

Salesforce B2C Commerce documentation — Log Settings and Log Files in Business Manager (Administration > Site Development > Development Setup > Log Settings), specifically the behavior of log file size limits and log rotation/archiving.
Question 15 Choose 1
A developer is working on a new feature that requires the use of a custom script. What is the first step the developer should take?
Show answerHide answer

Correct answer: B Define the custom script in the code.

Explanation

Explanation:

In Salesforce B2C Commerce (SFCC), when a developer needs a custom script (for example, a custom hook, a job step script, a payment/order hook, or any extension point), the workflow always begins in the codebase, not in Business Manager.

The first step is to define the custom script in the code — meaning the developer writes/creates the script file within the cartridge's directory structure (e.g., under `cartridge/scripts/...`) and registers it where the extension point expects it. This establishes the script's existence and its relationship to the feature being implemented.

Why the Other Options Are Incorrect:

A. Create the custom script in Business Manager.
– Business Manager is not where scripts are created or authored. Scripts are developed in code and deployed as part of a cartridge. Business Manager is only used to configure or register an existing script (e.g., assigning a hook script, selecting a job step script). Creating a script in Business Manager is not the first step — and in most cases, not even a step at all, since authoring happens in code.

C. Write the logic to handle the custom script.
– Writing the logic is indeed part of the process, but it is not the first step. Before writing the logic, the developer must first define the script in the codebase (create the file, place it in the proper location, and register it at the extension point). Writing logic inside an undefined or unregistered script would not integrate with the feature. Therefore, option C comes after option B in the workflow.

Reference:

Salesforce B2C Commerce documentation — Custom Scripts, Hooks, and Job Step Scripts in the SFCC development workflow, covering script definition, implementation, and registration.

That's the last free question in Application Development

You've seen the free 30% (15 of 53 questions). Full access unlocks every question and full-length Salesforce-B2C-Commerce-Developer mock exams, a different mock on every attempt.

Unlock full mock exam
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