Salesforce-B2C-Commerce-Cloud-Developer Practice Test Questions

Total 202 Questions


Last Updated On : 21-Jan-2026


undraw-questions

Think You're Ready? Prove It Under Real Exam Conditions

Take Exam

A Digital Developer wants pass control to an ISML template from a JavaScript Controller and load product on the pipeline dictionary with the name myProduct.
Which code sample will achieve this?



A. ISML.renderTemlpate ( "helloworld.isml", { "myProduct": "product" });


B. ISML.renderTemlpate ( "helloworld.isml", { "product": myProduct });


C. ISML.renderTemlpate ( "helloworld.isml", { product: myProduct });


D. ISML.renderTemlpate ( "helloworld.isml", { myProduct: product });





C.
  ISML.renderTemlpate ( "helloworld.isml", { product: myProduct });

Explanation:

The ISML.renderTemplate() method takes two arguments:

The template path (relative to the cartridge’s templates folder, excluding .isml).
A dictionary object containing key-value pairs that will be available in the ISML template.

In this case, the developer wants to load a product into the pipeline dictionary with the name myProduct.

The variable name in the controller is myProduct.

The dictionary key passed to the ISML template should be product (so that inside the ISML you can reference ${product} directly).

Therefore, the correct syntax is:
ISML.renderTemplate("helloworld.isml", { product: myProduct });

❌ Why the other options are incorrect:

A. ISML.renderTemlpate("helloworld.isml", { "myProduct": "product" });
Typo: renderTemlpate is invalid.
Also, this passes the string "product" instead of the actual product object.

B. ISML.renderTemlpate("helloworld.isml", { "product": myProduct });
Again, typo in renderTemlpate.
Even if corrected, the quotes around product are unnecessary in JavaScript object literal keys.

D. ISML.renderTemlpate("helloworld.isml", { myProduct: product });
This assumes a variable named product exists, but in the scenario the variable is myProduct.
This would throw a reference error unless product is separately defined.

Reference:
Salesforce B2C Commerce Developer Guide – ISML Rendering

A Digital Developer is inspecting the weekly service status report for a critical internally-hosted web service used in the application and notices that there are too many instances of unavailability.
Which two solutions are possible options to reduce the unavailability of the service? (Choose two.)



A. Modify the code that makes the request to the external service to be wrapped in a try / catch block.


B. Change the code that makes the request to set the throwOnError attribute, of the service, to be true


C. Increase the web service time out.


D. Update the external service to have a faster response time





C.
  Increase the web service time out.

D.
  Update the external service to have a faster response time

Explanation:

When a critical web service is frequently unavailable, you need to address either:

Timeout issues (client-side)
Slow or unreliable responses (server-side)
Or network instability

Let’s break down the correct answers and why they’re effective:

C. Increase the web service timeout
If the service is slow but eventually responds, the current timeout setting may be too short.
Increasing the timeout gives the service more time to respond, reducing the number of failed requests due to timeouts.
This is configured in Business Manager under Administration > Operations > Services.

D. Update the external service to have a faster response time
If the external service is consistently slow, optimizing it to respond faster is ideal.
This is a long-term fix that improves both user experience and application reliability.
This could involve database optimizations, load balancing, or API improvements on the external server.

Why the other options are incorrect:

A. Wrap code in try/catch block
This does not prevent service unavailability — it just handles the failure after it occurs.
Good for error handling, but not a solution for reducing failures.

B. Set throwOnError = true
This causes the service framework to throw an error on HTTP error responses (e.g., 500, 404).
Again, this is useful for error detection, but won’t reduce service unavailability — it just makes failures more visible.

A developer is working on a new site for the U.S based on an existing Canadian site. One of the requirements is a change to the address form. The current Canadian form has an list with the correct two-letter abbreviation for the provinces.
The U.S. requirements are to:

• Have an list with the correct two-letter abbreviation for the states in place of the province field.
• Set the U.S site locale.
• Add the options list field definition to the XML file.

How should the developer set up the files before making the required edits?



A. Create a copy of existing address.xml file in the default folder. Rename that file to adres_US.xml


B. Create a new sub-folder in the forms folder. Name it US. Copy existing address.xml file in the new folder


C. Create a copy of existing address.xml file in the default folder. Rename that file to address_en_US.xml


D. Create a new sub-folder in the forms folder. Name it en_US. Copy existing address.xml file in the new folder.





D.
  Create a new sub-folder in the forms folder. Name it en_US. Copy existing address.xml file in the new folder.

Explanation:

This question tests understanding of B2C Commerce locale-specific form customization using the site hierarchy.

Key Requirements
Modify the address form for the U.S. site.
Set the U.S. site locale (implied to be en_US).
Add or modify the field definition in the XML file.
The correct approach leverages the locale-based file resolution system in B2C Commerce.

How Form File Resolution Works
Forms are stored in forms/<locale>/. The system resolves the form file based on the current site's locale settings. The hierarchy typically is:
forms/<site_locale>/<form_name>.xml → forms/default/<form_name>.xml

Therefore, to customize the address.xml form specifically for the U.S. site (with locale en_US), you must:
Create the locale-specific folder: forms/en_US/.
Copy the base address.xml file from forms/default/ into this new folder.
Edit the copied file (forms/en_US/address.xml) to replace the province list with the U.S. states list.

This ensures that when the U.S. site (locale en_US) renders the address form, it automatically uses the customized version, while the Canadian site continues to use the default or an en_CA version.

Why the Other Options Are Incorrect
A. Create a copy of existing address.xml file in the default folder. Rename that file to adres_US.xml:
This is incorrect for multiple reasons. First, placing it in the default folder is not locale-specific. Second, renaming the file breaks the standard naming convention (address.xml). The system looks for a file named address.xml, not adres_US.xml.

B. Create a new sub-folder in the forms folder. Name it US. Copy existing address.xml file in the new folder:
The folder name must be a valid locale ID (like en_US, fr_CA, de_DE). US is not a valid locale ID. The system will not automatically resolve to this folder based on the site's locale setting.

C. Create a copy of existing address.xml file in the default folder. Rename that file to address_en_US.xml:
Similar to option A, this places the file in the wrong location (default folder) and uses an incorrect filename. The system expects the file to be named address.xml inside a locale-specific folder, not a locale-suffixed filename inside the default folder.

Key Concepts
Form Localization: B2C Commerce documentation describes how forms are resolved based on locale folders (forms/<locale>/) to support multi-region and multi-language sites.
Locale ID Standards: Locale IDs follow the pattern language_COUNTRY (for example, en_US, en_GB, fr_CA). This is what the site's locale is set to in Business Manager.
Site-Specific Customization: The correct method is non-destructive and upgrade-safe. You override only the specific form for the specific locale by placing a copy in the appropriate folder, leaving the base (default) form intact for other locales.

Summary
To customize a form for a specific locale (en_US), create a folder named after that locale inside forms/, copy the base XML file there, and modify the copy. This is the standard, documented best practice.

A Digital Developer is implementing an Open Commerce API call to add products to a basket. Given the following resource configuration:

Which modification allows the requests to successfully execute?



A. Change the "resource_id" value to: "/baskets/*/items"


B. Change the "write_attributes" value to: "(+items)"


C. Change the "read_attributes" value to: "(items)"


D. Change the "methods" value to: ["get", "post"]





D.
  Change the "methods" value to: ["get", "post"]

Explanation
The developer wants to add products to a basket using Open Commerce API (OCAPI).

Key OCAPI Rule
Adding items to a basket requires an HTTP POST request.
GET is read-only and cannot modify basket contents.

Given the resource configuration:
{
  "resource_id": "/baskets/**",
  "methods": ["get"],
  "read_attributes": "(**)",
  "write_attributes": "(**)"
}

The problem is that POST is not allowed, so any request that attempts to add products will fail due to insufficient permissions.

The Fix
Allow POST in the methods configuration:
"methods": ["get", "post"]

This enables successful execution of requests that add items to the basket.

Why the Other Options Are Incorrect
A. Change resource_id to /baskets/*/items ❌
While /baskets/{basketId}/items is the endpoint used to add items, the wildcard /baskets/** already covers this path. The issue is not the resource path.

B. Change write_attributes to (+items) ❌
Write attributes control what fields may be written, not whether the request method is allowed. Without POST, the call still fails.

C. Change read_attributes to (items) ❌
Read attributes affect response visibility only and have no impact on adding products.

Reference
OCAPI Basket Items – Add Product to Basket
OCAPI Settings (Methods and Permissions)

A Digital Developer has identified that the code segment below is causing performance problems.



What should the Developer do to improve the code?



A. Use a system attribute instead of the isOnSaleFlag custom attribute.


B. Avoid post-processing and use the isOnSaleFlag attribute as a search refinement.


C. Breaks the process into separate loops.


D. Avoid using an Iterator and use a Collection instead.





B.
  Avoid post-processing and use the isOnSaleFlag attribute as a search refinement.

Explanation:

The performance issue comes from post-processing search results in a loop:

while (productSearchHits.hasNext()) {
  foundProduct = productSearchHits.next();
  if (foundProduct.custom.isOnSaleFlag == "true") {
    results.add(foundProduct);
  }
}

What’s Happening
The product search returns all products.
The code then iterates through every result.
Filtering (isOnSaleFlag) happens in application code, not at the search level.
This is inefficient, especially for large catalogs.

Best Practice in B2C Commerce
Always filter at the search level whenever possible.
If isOnSaleFlag is a searchable or refinable custom attribute, it should be used as a search refinement in the product search model instead of filtering after the fact.

Benefits
Fewer products returned.
Less iteration.
Better performance.
Uses the platform’s optimized search index.

This directly addresses the performance issue.

Why the Other Options Are Incorrect
A. Use a system attribute instead of the custom attribute
Custom attributes can be indexed and refined just like system attributes. The issue is where filtering occurs, not the attribute type.
C. Break the process into separate loops
This would make performance worse, not better.
D. Avoid using an Iterator and use a Collection instead
The iterator is not the performance problem. The problem is processing too many results.

Reference
Salesforce B2C Commerce – Product Search and Refinements
Performance Best Practices – Avoid Post-Processing

A developer has the following files in template/resources:

account.proierties
weight.unit=kilos
account_en.propierties
weight.unit=stones
account_en_US.propierties
weight.unit= pounds

Using the default locale configuration, what is the current outcome of the page that renders the account.isml template snippet below when visiting the Sofrefront with the English for Canada(en_CA) locale=
Your parcel weighs 10 ${Resource.msg(‘weight.unit’,’account’)}



A. Your parcel weighs 10 stones.


B. Your parcel weighs 10 pounds


C. Your parcel weighs 10 undefined.


D. Your parcel weighs 10 kilos





A.
  Your parcel weighs 10 stones.

Explanation:

This question tests understanding of B2C Commerce's locale fallback logic for resource property files.

File Structure & Locale Analysis
account.properties – The default/base file (no locale suffix). Contains weight.unit=kilos.
account_en.properties – The file for the language English (en). Contains weight.unit=stones.
account_en_US.properties – The file for the specific locale English - United States (en_US). Contains weight.unit=pounds.

Current Site Locale: The user is visiting with locale en_CA (English - Canada).

Locale Resolution Hierarchy
B2C Commerce resolves resource messages using a specific-to-general fallback:
Exact locale match: account_en_CA.properties → NOT FOUND.
Language match: account_en.properties → FOUND! (en matches the language part of en_CA).
Default file: account.properties → This is only used if no language-specific file is found.

Since account_en.properties exists, the system will use the value from that file (weight.unit=stones). It does not fall back to the base account.properties because a valid language match (en) was found.

Template Execution
The line ${Resource.msg('weight.unit','account')} looks up the key weight.unit from the account bundle.
Following the resolution logic for en_CA, it retrieves the value stones from account_en.properties.

Therefore, the rendered text is: "Your parcel weighs 10 stones."

Why the Other Options Are Incorrect
B. Your parcel weighs 10 pounds
This would be correct only if the locale was en_US, as it uses account_en_US.properties.

C. Your parcel weighs 10 undefined
This would only happen if the key weight.unit was missing from all resolved property files (including the base default). It is found in account_en.properties.

D. Your parcel weighs 10 kilos
This would be correct only if there were no account_en.properties file, forcing a fallback to the base account.properties. Since account_en.properties exists, it takes precedence for any en_* locale.

References:
Resource Bundle Localization Fallback: The system searches in this order for a given locale {language}_{country}:
bundle_{language}_{country}.properties
bundle_{language}.properties
bundle.properties

Locale-Specific Customization: This mechanism allows developers to provide translations/regional variations for different markets while maintaining a common base.
Resource.msg() Method: The method parameters are (key, bundleName, locale?). If no locale is specified, it uses the current request's locale.

Summary
For locale en_CA, the system resolves to the language-level file account_en.properties, returning "stones".

A Digital Developer adds the following line of code to a script



The code executes without error; however, the log file on disk does NOT contain the log message. Which two actions should be completed to write the log message to disk? (Choose two.)



A. Ensure that the debug log level is enabled to write to file in the Custom Log Settings Business Manager module


B. Archive old log files to make room in the log directory.


C. Ensure that the “login” category is added to the Custom Log Filters in the Log Settings Business Manager module.


D. Ensure that the debug log level has been added to the custom log level types in the Global Preferences business manager module





A.
  Ensure that the debug log level is enabled to write to file in the Custom Log Settings Business Manager module

C.
  Ensure that the “login” category is added to the Custom Log Filters in the Log Settings Business Manager module.

Explanation
The code:
dw.system.Logger.getLogger('login').debug('Login API has succeeded');

executes correctly, but no log entry appears on disk.
In Salesforce B2C Commerce, for a log message to be written to disk, two independent configurations must allow it:

Required Configurations
A. Debug log level must be enabled
debug() messages are not written by default in many environments.
In Business Manager → Administration → Operations → Custom Log Settings, the DEBUG log level must be enabled for file output.
If DEBUG is disabled, the message is silently ignored.

C. The login category must be allowed
getLogger('login') uses login as the log category.
Categories must be explicitly listed in Custom Log Filters.
If the category is missing, no log entry is written, even if the log level is enabled.

Why the Other Options Are Incorrect
B. Archive old log files
Log rotation and disk space are handled automatically. Lack of space would cause errors, not silent failures.

D. Add debug log level to Global Preferences
DEBUG is a standard log level. You do not need to define it as a custom level.

Reference
Salesforce B2C Commerce – Logging Configuration
Custom Log Settings & Filters

Given the code snippet aboce, what should be added after this code so it can be used for page component display?



A. Base.render = render;


B. Module.exports.render = render;


C. Module.exports = render;


D. Module.exports = server.exports();





D.
  Module.exports = server.exports();

Explanation
In Salesforce B2C Commerce SFRA (Storefront Reference Architecture), page components (also called "ISML components", "renderable modules", or "cartridge modules") are small, reusable pieces of functionality that can be rendered via controllers or included directly in templates using <isinclude template="...">.

Why B is Correct
module.exports.render = render;
→ This is the exact convention used in SFRA for page components.
→ When a template includes <isinclude template="components/myComponent" />, SFRA looks for a file cartridge/components/myComponent.js (or in app_storefront_base, etc.).
→ It then calls the exported function named render and passes a context object to it.
→ This allows the component to render its own ISML template and populate the context if needed.

Why the Other Options Are Incorrect
A. Base.render = render;
→ There is no global Base object in SFRA page components. This is invalid and would throw an error.

C. Module.exports = render;
→ This overwrites the entire module export with just the function.
→ SFRA expects an object with a render property (i.e., { render: function }).
→ Exporting the function directly breaks the component loading mechanism.

D. Module.exports = server.exports();
→ server.exports() is used in controllers (not page components).
→ Controllers register routes with server.get(), server.post(), etc., and export the whole server instance.
→ Page components do not use routes — they only need to export a render function.

A Digital Developer needs to add a new form to the shopping cart page to allow customers to enter their rewards pass ID. There is already an existing Cart.js controller that handles processing of the other cartforms. In addition, a form field node is in the form XML and the necessary form input is present in the ISML template. The code below is the submit button for the ISML markup.



A. Option A


B. Option B


C. Option C


D. Option D





A.
  Option A

Explanation:

Why Option A is Correct
In SFCC form handling (the classic Forms Framework used with pdict.CurrentForms and Form.handleAction()), a submit button like:

<button type="submit"
    value="${pdict.CurrentForms.cart.addRewardPass.htmlName}"
    name="${pdict.CurrentForms.cart.addRewardPass.htmlName}">
    ${Resource.msg('rewards.apply','locale',null)}
</button>

is designed to trigger a form action named addRewardPass.

For that action to work, two things must exist:
1. The action must be declared in the form XML
   Add an <action /> node under the cart form definition with:
   formid="addRewardPass"
2. The controller must map that action to a handler function
   In Cart.js, where it calls Form.handleAction(), add a key named addRewardPass whose value is the function that processes the request.

That’s exactly what Option A describes.

Why the Other Options Are Wrong
B ❌ Uses <submit /> — that is not the form-action node used for this framework.
C ❌ addtl-form-action is not the documented requirement here; the framework relies on the form XML <action> plus Form.handleAction() mapping.
D ❌ If you add an action to the XML but don’t add the handler mapping in the controller, the submit won’t be processed correctly.

A developer needs to show only car accessories when shoppers use the search term car accessories and exclude technology accessories and household accessories. Given the above requirement, what is the recommended approach using the Search Dictionaries Dashboard?



A. Create a Synonym Dictionary entry: car accessories, household, technology.
Use search mode Exact Match


B. Create a Common Phrase Dictionary entry: car accessories, NOT household, NOT technology. Use search mode Exact Match.


C. Create a Synonym Dictionary entry: car accessories, household, technology. Use search mode First Word.


D. Create a Common Phrase Dictionary entry: car accessories.
Use search mode Exact Match





D.
  Create a Common Phrase Dictionary entry: car accessories.
Use search mode Exact Match

Explanation:

This question tests the understanding of Search Dictionaries and their correct application for search term precision.

The requirement is: Show only car accessories when shoppers use the search term "car accessories", and exclude technology accessories and household accessories.

Purpose of Each Dictionary Type
Common Phrase Dictionary: This is used to treat a specific multi-word phrase as a single, precise search term. When "Exact Match" mode is used, it ensures that results are returned only when the shopper enters that exact phrase. It does not add synonyms or variations.

Synonym Dictionary: This is used to expand a search term to include synonyms or related terms. For example, mapping "car" to "automobile, vehicle". This is the opposite of the requirement, as it would broaden, not narrow, the results.

Why Option D is Correct
Common Phrase Dictionary entry: "car accessories" tells the search engine to treat "car accessories" as one specific unit.
Search mode: Exact Match ensures that this dictionary entry only applies when the shopper types the phrase exactly as defined ("car accessories"). It will not trigger on "accessories for car" or "car and accessories".
Result: When a user searches for the exact phrase "car accessories", the search engine looks for products explicitly matching that phrase. Since "technology accessories" and "household accessories" are different phrases, they are naturally excluded. The dictionary does not need to contain "NOT" statements; its precise matching inherently provides the required filtering.

Why the Other Options Are Incorrect
A & C: Create a Synonym Dictionary entry...
A synonym dictionary would add "household" and "technology" as alternative search terms when someone searches for "car accessories". This would cause the search to return household and technology accessories, which is the exact opposite of the requirement.

B: Create a Common Phrase Dictionary entry: car accessories, NOT household, NOT technology
This syntax is invalid. Common Phrase entries do not support Boolean operators (NOT, AND, OR) within the phrase definition. Boolean logic is handled at the query level, not in the search dictionary. The dictionary's job is to define the phrase, not to apply query logic.

Key References & Concepts
Search Dictionaries Documentation:
- Common Phrase: Used for precise phrase matching (e.g., brand names, specific product lines). "Exact Match" mode is for precision.
- Synonym: Used for broadening searches by linking related terms.

Exact Match vs. First Word Mode: "Exact Match" requires the entire phrase. "First Word" mode would apply the rule if the phrase starts with the defined words, which could cause unintended matches.

Achieving Precision: To restrict results to a very specific category, you use a Common Phrase Dictionary with Exact Match. This ensures the search is interpreted literally, not expanded.

Summary
To guarantee that the search term "car accessories" returns results for only that category and excludes others, define it as a Common Phrase with Exact Match. This uses the search dictionary for its intended purpose: precise phrase recognition, not Boolean filtering.

Page 2 out of 21 Pages
Salesforce-B2C-Commerce-Cloud-Developer Practice Test Home

Experience the Real Exam Before You Take It

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.



Enroll Now

Ready for the Real Thing? Introducing Our Real-Exam Simulation!


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:

  • Building Exam Stamina: Practice maintaining focus and accuracy for the entire duration.
  • Mastering Time Management: Learn to pace yourself so you never have to rush.
  • Boosting Confidence: Walk into your Salesforce-B2C-Commerce-Cloud-Developer exam knowing exactly what to expect, eliminating surprise and anxiety.
  • A New Test Every Time: Our Salesforce Certified B2C Commerce Cloud Developer - Comm-Dev-101 exam questions pool ensures you get a different, randomized set of questions on every attempt.
  • Unlimited Attempts: Take the test as many times as you need. Take it until you're 100% confident, not just once.

Don't just take a Salesforce-B2C-Commerce-Cloud-Developer test once. Practice until you're perfect.

Don't just prepare. Simulate. Succeed.

Take Salesforce-B2C-Commerce-Cloud-Developer Practice Exam