ExamGecko
Home Home / Salesforce / Certified B2C Commerce Developer

Salesforce Certified B2C Commerce Developer Practice Test - Questions Answers, Page 7

Question list
Search
Search

List of questions

Search

Related questions











In Log Center, a developer notes a number of Cross Site Request Forgery (CSRF) log entries. The developer knows that this happens when a CSRF token is either not found or is invalid, and is working to remedy the situation as soon as possible.

Which two courses of action might solve the problem? (Choose two.)

A.
Extend the CSRF token validity to avoid timeouts
A.
Extend the CSRF token validity to avoid timeouts
Answers
B.
Delete the existing CSRF whitelists in Business Manager
B.
Delete the existing CSRF whitelists in Business Manager
Answers
C.
Add the token in the ISML template
C.
Add the token in the ISML template
Answers
D.
Add csrfProtection.generateToken as a middleware step in the controller
D.
Add csrfProtection.generateToken as a middleware step in the controller
Answers
Suggested answer: A, B

A developer needs to update the package.json file so that it points to the hook file for a cartridge, using the hooks keyword.

Which snippets works correctly when added to the file?

A.
{"hooks": "./scripts/hooks.json"}
A.
{"hooks": "./scripts/hooks.json"}
Answers
B.
{hooks: ./cartridge/scripts/hooks.json}
B.
{hooks: ./cartridge/scripts/hooks.json}
Answers
C.
{hooks: ./scripts/hooks.json}
C.
{hooks: ./scripts/hooks.json}
Answers
D.
{"hooks": "./cartridge/scripts/hooks.json"}
D.
{"hooks": "./cartridge/scripts/hooks.json"}
Answers
Suggested answer: D

Explanation:

Reference: https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2Fcontent%2Fb2c_commerce%2Ftopics%2Fsfra%2Fb2c_sfra_hooks.html

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 product is ${myProduct.getID()} with name ${myProduct.getName()}');
A.
Logger.warn('The current product is ${myProduct.getID()} with name ${myProduct.getName()}');
Answers
B.
Logger.warn('The current product is {0} with name {1}', myProduct.getID(), myProduct.getName());
B.
Logger.warn('The current product is {0} with name {1}', myProduct.getID(), myProduct.getName());
Answers
C.
Logger.warn('The current product is %s with name %s').context(myProduct.getID(), myProduct.getName());
C.
Logger.warn('The current product is %s with name %s').context(myProduct.getID(), myProduct.getName());
Answers
D.
Logger.warn('The current product is {0} with name {1}'}.context(myProduct.getID(), myProduct.getName());
D.
Logger.warn('The current product is {0} with name {1}'}.context(myProduct.getID(), myProduct.getName());
Answers
Suggested answer: B

A NewsletterSubscription custom object exists that has a key attribute named email of type String and the following script code.

var CustomObject = dw.object.CustomObjectMgr.createCustomObject('NewsletterSubscription' newsletterForm.email.value);

However, the NewsletterSubscription custom object is not persisted. What is a possible reason?

A.
The code shown is the wrong syntax. The correct syntax is:var CustomObject = dw.object.CustomObjectMgr.createCustomObject('NewsletterSubscription' 'email' newsletterForm.email.value);
A.
The code shown is the wrong syntax. The correct syntax is:var CustomObject = dw.object.CustomObjectMgr.createCustomObject('NewsletterSubscription' 'email' newsletterForm.email.value);
Answers
B.
The code shown needs to be wrapped in a try/catch block
B.
The code shown needs to be wrapped in a try/catch block
Answers
C.
The code shown is the wrong syntax. The correct syntax is:var CustomObject = dw.object.CustomObjectMgr.createCustomObject(newsletterForm.email.value 'NewsletterSubscription');
C.
The code shown is the wrong syntax. The correct syntax is:var CustomObject = dw.object.CustomObjectMgr.createCustomObject(newsletterForm.email.value 'NewsletterSubscription');
Answers
D.
The code shown needs to be wrapped in a transaction.
D.
The code shown needs to be wrapped in a transaction.
Answers
Suggested answer: A

A retailer notices that the Account Addresses page is showing the wrong shopper's address.

Which tool should the developer start with to identify the issue?

A.
Pipeline Profiler
A.
Pipeline Profiler
Answers
B.
Code Profiler
B.
Code Profiler
Answers
C.
Reports and Dashboards module
C.
Reports and Dashboards module
Answers
D.
Storefront Toolkit
D.
Storefront Toolkit
Answers
Suggested answer: B

A developer is implementing new Page Designer content on a merchant's Storefront and adds the line below to the setupContentSearch function in the searchHelpers.js file.

apiContentSearchModel.setFilteredByFolder(false);

What does this achieve?

A.
Filters Page Designer search results into folders
A.
Filters Page Designer search results into folders
Answers
B.
Prevents Page Designer pages from being searchable
B.
Prevents Page Designer pages from being searchable
Answers
C.
Allows Page Designer pages and components to be searchable
C.
Allows Page Designer pages and components to be searchable
Answers
D.
Allows filtering Page Designer pages by folder
D.
Allows filtering Page Designer pages by folder
Answers
Suggested answer: D

Consider the following information:

A merchant has this three-tier category structure setup in the Storefront catalog.

- New Arrivals > Women > Clothing

The category named Clothing has all the clothing items for Women and is merchandised. A Search Refinement named Newness is correctly configured for the Clothing category.

When a merchandiser views the Clothing category, the Search Refinement appears and works as expected. However, the merchandiser does not see the Search Refinement when searching for Clothing via the Storefront search.

What is the reason?

A.
The Search Refinement definition is not set up for the New Arrivals category
A.
The Search Refinement definition is not set up for the New Arrivals category
Answers
B.
There are conflicting Search Refinement definitions for Clothing and one of its parent categories
B.
There are conflicting Search Refinement definitions for Clothing and one of its parent categories
Answers
C.
The Search Refinement definition is not set up for the Women category
C.
The Search Refinement definition is not set up for the Women category
Answers
D.
The Search Refinement definition is not set up for the Root category
D.
The Search Refinement definition is not set up for the Root category
Answers
Suggested answer: A

Given the requirement to add caching to an existing page while adhering to SFRA best practices, which code snippet should be used?

A.
server.get('Show', cache.applyDefaultCache, function (req, res, next) {// code});
A.
server.get('Show', cache.applyDefaultCache, function (req, res, next) {// code});
Answers
B.
<iscache varyby="price_promotion" type="relative" status="on"/>
B.
<iscache varyby="price_promotion" type="relative" status="on"/>
Answers
C.
server.get('Show', function (req, res, next) {//code}).applyDefaultCache();
C.
server.get('Show', function (req, res, next) {//code}).applyDefaultCache();
Answers
D.
<iscache type="relative" hour="24"/>
D.
<iscache type="relative" hour="24"/>
Answers
Suggested answer: A

Explanation:

Reference: https://documentation.b2c.commercecloud.salesforce.com/DOC1/index.jsp?topic=%2Fcom.demandware.dochelp%2Fsfrajsdoc%2Fjs%2Fserver%2Fapp_storefront_base_cartridge_controllers_Page.js.html

Given the SFRA Controller below:

Why would a JavaScript debugger, that is stopped at line 06, fail to show the viewData variable in the inspection tool?

A.
viewData is declared but not assigned
A.
viewData is declared but not assigned
Answers
B.
viewData is assigned but not declared
B.
viewData is assigned but not declared
Answers
C.
viewData is a B2C Script reserved name
C.
viewData is a B2C Script reserved name
Answers
D.
cache.applyDefaultCache is not a valid middleware
D.
cache.applyDefaultCache is not a valid middleware
Answers
Suggested answer: B

Which three configurations does a developer need to ensure to have a new product visible in the Storefront? (Choose three.)

A.
The Storefront catalog that contains the product is assigned to a site
A.
The Storefront catalog that contains the product is assigned to a site
Answers
B.
The product has a price
B.
The product has a price
Answers
C.
The product has a master product
C.
The product has a master product
Answers
D.
The product is online and searchable
D.
The product is online and searchable
Answers
E.
The search index is built
E.
The search index is built
Answers
Suggested answer: A, B, C

Explanation:

Reference: https://documentation.b2c.commercecloud.salesforce.com/DOC3/index.jsp?topic=%2Fcom.demandware.dochelp%2Fcontent%2Fb2c_commerce%2Ftopics%2Fproducts%2Fb2c_products.html

Total 209 questions
Go to page: of 21