Pre-Winter Sale Discount Flat 70% Offer - Ends in 0d 00h 00m 00s - Coupon code: 70diswrap

Salesforce Comm-Dev-101 Dumps

Page: 1 / 15
Total 154 questions

Salesforce Certified B2C Commerce Developer Questions and Answers

Question 1

Which snippet works correctly when updating the package.json file to point to the hook file for a cartridge?

Options:

A.

{ " hooks " : " ./cartridge/scripts/hooks.json " }

B.

{ " hooks " : " ./scripts/hooks.json " }

C.

{ hooks: " ./cartridge/scripts/hooks.json " }

Question 2

A developer is asked to create a controller endpoint that will be used in a client-side AJAX request. Its purpose is to display updated information to the user when the request is completed, without otherwise modifying the appearance of the current page.

According to SFRA practices, which method best supports this objective?

Options:

A.

res.json()

B.

res.render()

C.

res.print()

Question 3

To ensure SFRA best practices and protect against request forgery, the developer introduced CSRF token generation in the customer address form.

< form ... action= " submit " >

< input name= " ${dw.web.CSRFProtection.getTokenName()} "

value= " ${dw.web.CSRFProtection.generateToken()} " >

...

< the rest of the Form Fields >

....

< /form >

To implement CSRF protection when the form is submitted, the developer needs to introduce the CSRF validation using one or both of these methods as applicable:

validateRequest

validateAjaxRequest

Where in the code does the developer need to add this CSRF validation check?

Options:

A.

In the middleware chain of the controller post route

B.

In the controller function that displays the form

C.

In the model function that persists the form data

Question 4

Business Manager has the configuration:

• Active Log category is " root "

• Log level of WARN

The code below is executing:

varlog=Logger.getLogger( " products " );

Using this information, what will be written to the log?

Options:

A.

log.warn( " This is a warn message " ); AND log.error( " This is an error message " );

B.

log.error( " This is an error message " ); AND log.info( " This is an info message " );

C.

log.info( " This is a warn message " );

Question 5

The Home-Show route uses this middleware chain:

server.get( ' Show ' ,consentTracking.consent,cache.applyDefaultCache,

function(req,res,next) {

// base code here

}

);

The developer added Home.js in another cartridge, which is before the original cartridge in the cartridge path, to extend that route but it does not have the middleware chain:

server.append( ' Show ' ,function(req,res,next) {

// custom code here

});

Assuming the code is correct on both functions, what is the expected result?

Options:

A.

The base code executes and then the custom code executes.

B.

A RunTime error is thrown, " Error: Params do not match route " .

C.

The custom code executes and then the base code executes.

Question 6

A developer wants to add a link to the My Account page.

What is the correct code to accomplish this?

Options:

A.

< a href= " ${URLUtils.url( ' Account-Show ' )} " > ${Resource.msg( ' myaccount ' , ' account ' ,null)} < /a >

B.

< a href= " ${URLUtils( ' Account-Show ' )} " > ResourceMgr.getProperties( ' myaccount ' , ' account ' ,null) < /a >

C.

< a href= " ${URLUtils.get( ' Account-Show ' )} " > ${Resource.msg( ' myaccount ' , ' account ' , request.locale())} < /a >

Question 7

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?

Options:

A.

Develop and configure a steptype and corresponding CommonJS job step script.

B.

Implement and configure a recurring task using the cron command in Business Manager.

C.

Configure a new custom OCAPI endpoint and use the Customers resource type.

Question 8

Given the sandbox with:

• Service configured and assigned to its profile and credential

• A code version that uses that service

And given the requirement to limit the number of success or error calls the code can perform to a restricted number of calls per second. Which configuration should the developer perform?

Options:

A.

Set the service as limited and change the services profile site preferences with the required values.

B.

Set the rate limiter in the service profile and configure its values with the ones required.

C.

Set a new quota limit for the service profile and assign the service to it.

Question 9

A merchant asks a developer to create a Cache Partition for the home page, so that when the home page is edited, only the home page cache is cleaned.

Given the above requirement, where should the developer create that partition in Business Manager?

Options:

A.

Administration > Sites > Manage Sites > Site > Cache

B.

Operations > Site > Manage Sites > Cache

C.

Site > Site Preferences > Cache

Question 10

A developer uses the call() instance method of dw.svc.Service to invoke a web service and implemented the callback methods defined by the dw.svc.ServiceCallback class.

Which callback method is required only when invoking a SOAP service?

Options:

A.

createRequest

B.

mockCall

C.

initServiceClient

Question 11

What is the expected result when extending a route without the middleware chain?

Options:

A.

The base code executes and then the custom code executes.

B.

A RunTime error is thrown, " Error: Params do not match route " .

C.

The custom code executes and then the base code executes.

Question 12

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 < options > list with the correct two-letter abbreviation for the provinces.

The U.S. requirements are to:

Have an < options > 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?

Options:

A.

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

B.

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

C.

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

Question 13

A client has a requirement to allow users on the Storefront to filter by a newly created attribute. Which is necessary to achieve this?

Options:

A.

Add a new Search Refinement Definition.

B.

Set the attribute as Searchable.

C.

Change the productsearchrefinebar.isml template.

Question 14

The developer created a new Storefront category in storefront-catalog-m-en, but when viewing the Storefront site, the category is not visible.

Why might the categories not be visible?

Options:

A.

The category does not contain available products.

B.

The Storefront catalog is offline.

C.

The categories are not sorted.

Question 15

Reference the following code snippets that allow a form to function correctly.

Form definition (newsletter.xml):

< ?xmlversion= " 1.0 " ? >

< formxmlns= " " >

< fieldformid= " email " label= " Email: " type= " string "

mandatory= " true " max-length= " 50 " / >

< /form >

Controller snippet:

varnewsletterForm=server.forms.getForm( ' newsletter ' );

res.render( ' NewsletterTemplate ' ,{newsletterForm:newsletterForm});

Template snippet:

< form action= " ${URLUtils.url( ' Newsletter-Submit ' )} " method= " POST "

< isprint value= " ${EXPRESSION.attributes} " encoding= " off " / > >

< input type= " input " id= " email "

< isprint value= " ${EXPRESSION.email.attributes} " encoding= " off " / > >

< button type= " submit " > Submit < /button >

< /form >

Which code should a developer insert at the EXPRESSION placeholder in the ISML template snippet above to have the form work as expected?

Options:

A.

pdict.newsletterForm

B.

pdict.newsletter

C.

newsletterForm

Question 16

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?

Options:

A.

Logger.warn( ' The current product is {0} with name {1} ' ,myProduct.getID(),myProduct.getName());

B.

Logger.warn( ' The current product is ${myProduct.getID()} with name ${myProduct.getName()} ' );

C.

Logger.warn( ' The current product is {0} with name {1} ' ).context(myProduct.getID(),myProduct.getName());

Question 17

Given a sandbox with an active slot configuration with the following specifications:

Content type set to product

With some product configured

With the following rendering template:slots/product/product_1x2.isml

Correctly enabled and scheduled

And given the code contained in the selected rendering template:

< isif condition= " ${!empty(slotcontent)} " >

< isloop iterator= " ${slotcontent.content} " alias= " product " >

< div class= " product " >

< isprint value= " ${product.getID()} " > < br / >

< isprint value= " ${product.getName()} " > < br / >

< /div >

< /isloop >

< /isif >

Is an additional action needed for this to work as intended?

Options:

A.

No - The content slot is rendered correctly.

B.

Yes - The isloop should be removed because no loops are allowed in a content slot rendering template.

C.

Yes - The content needs to be configured with a recommender to display products.

Question 18

Given the following OCAPI definitions, which permission or permissions apply?

{

" resource_id " : " /sites/*/coupons/* " ,

" methods " :[

" put "

],

" read_attributes " : " (**) " ,

" write_attributes " : " (**) "

}

Options:

A.

Allows external applications to create coupons

B.

Allows external applications to create, update, and delete coupons

C.

Allow external applications to create, update, and delete both coupons and coupon codes

Question 19

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?

Options:

A.

npm run compile:js, npm run compile:html, npm run clean

B.

npm run compile:js, npm run compile:scss, npm run compile:html

C.

npm run compile:js, npm run compile:scss, npm run compile:fonts

Question 20

A developer has custom debug statements in a script, but the messages are not showing up in the Storefront Toolkit Request Log.

Which step needs to be completed to get the messages to appear in the Request Log?

Options:

A.

In Site Preferences, check the box for Enable custom logging in Request Log.

B.

In Custom Log Settings, activate the logging category at DEBUG level.

C.

In Global Preferences, check the box for Enable custom logging in Request Log.

Question 21

A developer is using the Script Debugger to troubleshoot an issue. They observe that the debugger is not able to resolve a specific breakpoint on one of the scripts. What is a possible reason for this issue?

Options:

A.

The cartridge containing the script is not in the site ' s cartridge path.

B.

The script debugging session is not active.

C.

The script is from a third-party cartridge and hence does not allow setting breakpoints.

Question 22

A merchant uploads an image using the Content Image Upload module of Business Manager.

Which module can the merchant use to display the image on the Storefront?

Options:

A.

Content slots

B.

Product images

C.

Payment methods

Question 23

A developer is asked to implement a simple call to an authentication-protected REST web service.

Which configuration is valid?

Options:

A.

Add the authentication password to the service credentials.

B.

Configure the authentication username using a site preference.

C.

Insert the service ' s endpoint in a.propertiesfile.

Question 24

Which method should a developer use to create a service instance that will call a remote web service?

Options:

A.

dw.svc.LocalServiceRegistry.createService()

B.

dw.svc.LocalServiceInstance

C.

dw.svc.LocalServiceRegistry.getDefaultService()

Question 25

A developer is configuring Payment Methods on a storefront. Which of the following considerations should be kept in mind while configuring payment methods?

Options:

A.

You can ' t delete a default payment method. You can only disable it.

B.

You can add only up to 5 payment methods.

C.

You can ' t drag and drop the column headers to change the sort order.

Question 26

There are three logging categories: category1, category1.eu, and category1.us. In Business Manager, category1 is enabled for WARN level and no other categories are configured. All custom log targets are enabled.

The code segment below executes.

varlogger=Logger.getLogger( " loggerFile " , " category1.eu " );

logger.warn( " This is a log message " );

What is the result?

Options:

A.

Logs will be written to the log file with a prefix loggerFile.

B.

Logs will be written to the log file with a prefix custom-loggerFile.

C.

Logs will be written to the log file with a prefix customwarn.

Question 27

Given the SFRA Controller below:

01varserver=require( ' server ' );

02varcache=require( ' */cartridge/scripts/middleware/cache ' );

03

04server.get( ' Show ' ,cache.applyDefaultCache,function(req,res,next) {

05viewData={name: ' my string ' };

06res.render( ' /pages/mypage ' ,viewData);

07next();

08});

09

10module.exports=server.exports();

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

Options:

A.

viewData is assigned but not declared.

B.

cache.applyDefaultCache is not a valid middleware.

C.

viewData is a B2C Script reserved name.

Question 28

A developer is tasked with creating a new payment method in Business Manager. What is the first step the developer should take?

Options:

A.

Create a new payment processor.

B.

Create a new payment method.

C.

Configure the payment method settings.

Question 29

A developer needs to implement a new feature that requires the use of a custom attribute. What is the first step the developer should take?

Options:

A.

Create the custom attribute in Business Manager.

B.

Define the custom attribute in the code.

C.

Write the logic to handle the custom attribute.

Question 30

A merchant wants customers to be able to order gift vouchers via their site. Since they can issue an unlimited number of these digital vouchers, this item should be available to sell at all times.

How can a developer use Business Manager to ensure that the gift vouchers are always available?

Options:

A.

Check the perpetual flag in the product inventory record.

B.

Manually set the inventory to a high number.

C.

Set StockLevel = maxAllocation for the product.

Question 31

A developer wants to configure multiple products that should only be sold as a group. It should not be possible for buyers to buy these products individually. How should the developer configure the products?

Options:

A.

Bundle

B.

Set

C.

Variation Group

Question 32

A client has a requirement to allow users on the Storefront to filter by a newly created attribute.

After creating the search refinement, what else is necessary to achieve this?

Options:

A.

Ensure the attribute has data and is indexed.

B.

Set the attribute as Searchable.

C.

Change the productsearchrefinebar.isml template.

Question 33

A developer is working on a feature that requires the use of a third-party API. What is the best practice for handling API responses in Salesforce B2C Commerce?

Options:

A.

Ignore error responses and proceed with the default behavior.

B.

Log all responses for debugging purposes and handle errors gracefully.

C.

Always return a success response to the user, regardless of the API response.

Question 34

What should a developer do to ensure that the gift vouchers are always available?

Options:

A.

Manually set the inventory to a high number.

B.

Set StockLevel = maxAllocation for the product.

C.

Check the perpetual flag in the product inventory record.

Question 35

A merchant has a new requirement to accept American Express credit cards on its Storefront. A credit card payment method already exists.

Which step must a developer take in Business Manager to achieve this?

Options:

A.

In Payment Methods, enable American Express as a credit card type.

B.

In Payment Processor, create American Express as a payment type.

C.

Add American Express as a Payment Preference in Site Preferences.

Question 36

A developer needs to display a products list of their " Women Dresses " category in a new web application, independent of their main B2C Commerce site. This custom listing page needs to be styled differently from the existing one, as per marketing requirements. Which B2C Commerce tool should the developer use to collect the necessary information?

Options:

A.

The ProductSearch resource of the Shop OCAPI.

B.

The Search-Show Controller URL to perform a web crawl.

C.

The existing category ' s endpoint to perform a REST call.

Question 37

A merchant wants to obtain an export file that contains all the products assigned to their Storefront catalog. They do not know how to achieve this easily without manual processing, so asked their developer to help generate this. The merchant ' s instance setup is as follows:

• They have one Master catalog and one Storefront catalog.

• Some, but not all, of the products in the Master catalog are assigned to categories within the Storefront catalog.

Which method allows the developer to generate the export for the merchant?

Options:

A.

Using the Catalog Import and Export module, export the Master catalog with a category-assignment search to export specific products.

B.

Using the Site Import and Export module, export both the Site catalog and the Master catalog in a single archive.

C.

Using the Site Import and Export module, export the Master catalog filtered by the Site catalog categories to export specific products.

Question 38

A developer customized the Cart-Show controller route with a LINK cartridge that adds social media data. There is a new requirement to add a dataLayer object to the Cart-Show controller route.

How should the developer achieve this to ensure that no code change will be needed if the client decides to remove the LINK cartridge?

Options:

A.

Replace the Cart-Show controller route in client cartridge and add dataLayer object to the viewData variable.

B.

Replace the Cart-Show controller route in client cartridge and add dataLayer object to the viewData variable. Ensure that the client cartridge is on the left of the LINK cartridge in cartridge path.

C.

Append Cart-Show controller route in the client cartridge and add dataLayer object to the viewData variable.

Question 39

A developer configures the dw.json file and needs to fill in the necessary parameters to complete the task.

Which parameter is required when using npm scripts?

Options:

A.

Username

B.

CSRF Token

C.

Site ID

Question 40

What step should a developer take to troubleshoot code changes not appearing on the Storefront?

Options:

A.

Check the Business Manager site cartridge path.

B.

Check that the correct code version is selected.

C.

Check that the search index was recently rebuilt.

Question 41

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 snippet works correctly when added to the file?

Options:

A.

{ " hooks " : " ./cartridge/scripts/hooks.json " }

B.

{ hooks: ./cartridge/scripts/hooks.json }

C.

{ " hooks " : " ./scripts/hooks.json " }

Question 42

The client provides the system integrator with translation messages for the newly added " French " ( " fr " ) locale.

What is the correct folder to store the associated.propertiesfiles?

Options:

A.

cartridge/templates/resources

B.

cartridge/resources

C.

cartridge/templates/resources/fr

Question 43

A developer needs to perform the same additional checks before completing multiple routes in a custom controller, in order to decide whether to render a template or redirect the user to a different page.

According to SFRA best practices, what is the correct approach to improve code reusability in this scenario?

Options:

A.

Define a new middleware function and use it in the existing routes.

B.

Append a new function to all the existing routes with the server module.

C.

Use the superModule property in the existing routes to extend their functionality.

Question 44

A client that sells to multiple countries in Europe needs to disable Apple Pay for Denmark.

Which Business Manager module is used to achieve this requirement?

Options:

A.

Payment Methods

B.

Payment Processors

C.

Locale Payments

Question 45

The developer has been given the following business requirement:

The shipping method, " Free Standard Ground Shipping " has an exclusion for products with ' category equals or is child of electronics-televisions. '

The marketing department has scheduled a sale offering a " Free Standard Ground Shipping " method for brand XyzTv televisions for the next 3 months.

What method accomplishes this while following best practices?

Options:

A.

Extend the code in cartridge/models/shipping/shippingMethod.js using module.superModule and add an exception for the specified brand.

B.

Extend the CheckoutShippingServices controller using module.superModule and add an exception for the specified brand.

C.

Create an allow list for the existing shipping method by adding a product exclusion for ' brand equals XyzTv ' to the exclusion list for " Free Standard Ground Shipping. "

Question 46

Given a NewsletterSubscription custom object that has a key attribute named email of type String, what is the correct syntax to create the NewsletterSubscription custom object?

Options:

A.

varCustomObject=dw.object.CustomObjectMgr.createCustomObject( ' NewsletterSubscription ' ,newsletterForm.email.value);

B.

varCustomObject=dw.object.CustomObjectMgr.createCustomObject(newsletterForm.email.value, ' NewsletterSubscription ' );

C.

varCustomObject=dw.object.CustomObjectMgr.createCustomObject( ' NewsletterSubscription ' , ' email ' ,newsletterForm.email.value);

Page: 1 / 15
Total 154 questions