Month End Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: my75ex

Home > Salesforce > Developers > Comm-Dev-101

Comm-Dev-101 Salesforce Certified B2C Commerce Developer Question and Answers

Question # 4

To implement site custom functionality, a developer creates a new cartridge.

Which step should the developer take to ensure their cartridge changes take effect?

A.

Add the new cartridge to the cartridge path for the Business Manager site.

B.

Rebuild the site indexes to capture incremental changes.

C.

Add the new cartridge to the cartridge path for the relevant Storefront site.

Full Access
Question # 5

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?

A.

Change the Log Level for myLogCategory to DEBUG.

B.

Check the DEBUG box in the Log Files section.

C.

Change the Log Level for myLogCategory to DEBUG and check the DEBUG box in the Log Files section.

Full Access
Question # 6

Which of these situations is an appropriate use of the B2C Commerce OCAPIs?

A.

Updating inventory information from a warehouse management software.

B.

Extending System Object Type definitions with new attributes.

C.

Showing the customer ' s information in their B2C Commerce " My Account " page.

Full Access
Question # 7

The developer needs to add custom category debug logging into the " contact " script, to ensure that a third-party service call responds as expected.

Assuming that the logging configurations for the contact category are correctly in place, which line of code should the developer add in the 06 placeholder to meet this requirement?

01varLogger=require( ' dw/system/Logger ' );

02varservice=dw.svc.LocalServiceRegistry.createService( ' contact.http.submit ' ,options);

03varserviceResponse=service.call(requestJSON);

04

05if(serviceResponse.ok) {

06// Insert logging code here

07}

A.

Logger.getLogger( ' contact ' ).debug( ' Contact service responded with OK. ' )

B.

Logger.debug( ' Contact service responded with OK. ' )

C.

Logger.customLogger( ' contact ' ).debug( ' Contact service responded with OK. ' )

Full Access
Question # 8

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.

Enables searching to find Page Designer content assets that are not in folders.

B.

Extends the ContentSearchModel to allow the folder filter.

C.

Prevents Page Designer pages and components from being searchable.

Full Access
Question # 9

Which item is appropriate content for custom logs implemented at checkout?

A.

Order failure information

B.

Customer ' s password at post-checkout sign up

C.

Transaction ' s credit card information

Full Access
Question # 10

Which is an appropriate use of the < isif > ISML tag that follows B2C Commerce and SFRA best practices?

A.

Show a different < div > tag depending on a pdict Boolean variable.

B.

Implement involved business logic through conditional statements.

C.

Redirect users to the registration page if they are not logged in.

Full Access
Question # 11

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?

A.

Bundle

B.

Set

C.

Variation Group

Full Access
Question # 12

Which item is appropriate content for custom logs implemented at checkout?

A.

Payment gateway service response code

B.

Customer ' s password at post-checkout sign up

C.

Transaction ' s credit card information

Full Access
Question # 13

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

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.

Full Access
Question # 14

A developer needs to render a Page Designer page in JSON format. What is the correct syntax?

A.

PageMgr.serializePage(pageID, {parameter1:value1});

B.

JSON.stringify(PageMgr.renderPage(pageID, {parameter1:value1}));

C.

PageMgr.renderPage(pageID, {parameter1:value1})

Full Access
Question # 15

What is the expected result when the code segment executes with the logger configuration?

A.

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

B.

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

C.

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

Full Access
Question # 16

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?

A.

< a href= " ${URLUtils.url( ' Page-Include ' , ' cid ' , ' about-us ' )} " > ${Resource.msg( ' aboutus ' , ' content ' ,null)} < /a >

B.

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

C.

< iscontent url= " ${URLUtils.url( ' Page-Include ' , ' cid ' , ' about-us ' )} " >

Full Access
Question # 17

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?

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);

Full Access
Question # 18

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

Which configuration is valid?

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.

Full Access
Question # 19

A developer cannot create a custom object in Business Manager because the attributes do not show. The developer can view the object but not the attributes.

Which action should the developer take to resolve the problem?

A.

Change the data type of the attributes.

B.

Create an Attribute Group with the desired attributes in it.

C.

Set the attributes to site-specific replicable.

Full Access
Question # 20

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?

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

Full Access
Question # 21

What is the action needed for the content slot to work as intended?

A.

No; The content slot is rendered correctly.

B.

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

C.

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

Full Access
Question # 22

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

A.

Add a new Search Refinement Definition.

B.

Set the attribute as Searchable.

C.

Change the productsearchrefinebar.isml template.

Full Access
Question # 23

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?

A.

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

B.

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

C.

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

Full Access
Question # 24

What should a developer implement to enhance the functionality of an existing controller route?

A.

Use the " append " method of the server module for the existing route.

B.

Replace the callback function of the existing route using superModule.

C.

Use the " extend " method of the server module for the existing route.

Full Access
Question # 25

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?

A.

Ensure the attribute has data and is indexed.

B.

Set the attribute as Searchable.

C.

Change the productsearchrefinebar.isml template.

Full Access
Question # 26

A client sells its product in single-brand stores as well as in multi-brand stores. When shown in the store locator list, the client wants the single-brand stores to have a particular background color to highlight them.

Which Business Manager action should be completed to allow the developer to apply different styling to the single-brand stores?

A.

Add a Boolean custom attribute to the Store system object.

B.

Create a new SingleBrandStore custom object configuration.

C.

Adjust the relevant Site Preference in the Stores group.

Full Access
Question # 27

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?

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.

Full Access
Question # 28

A developer implements the necessary code for a new Page Designer component.

What is the purpose of the JSON metadata definition file the developer creates?

A.

Defines regions within the component type.

B.

Defines the responsive layout of the rendered template.

C.

Defines the business and rendering logic of the component required by the merchant.

Full Access
Question # 29

Given the requirements:

• To show the washing instructions for a clothing product on a dedicated section of the detail page

• Washing instructions come from the product information manager (PIM)

• To have this attribute available to localize in the Storefront

Which action meets these requirements?

A.

Create a custom attribute on the product system object and set it as localizable.

B.

Add a resource file for every locale for which the attribute needs to be translated.

C.

Set the product system object type as localizable.

Full Access
Question # 30

A merchant checked the " Show Orderable Products Only " preference in Business Manager.

What impact does this have on the Storefront from a user perspective?

A.

Products with an Available to Sell (ATS) = 0 will be excluded from search results.

B.

Back-order products will be excluded from search results.

C.

The product detail page will be hidden if Available to Sell (ATS) = 0.

Full Access
Question # 31

A developer has the following files in template/resources:

• account.properties - > weight.unit=kilos

• account_en.properties - > weight.unit=stones

• account_en_US.properties - > 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 Storefront with the English for Canada (en_CA) locale?

Your parcel weighs 10 ${Resource.msg( ' weight.unit ' , ' account ' ,null)}.

A.

Your parcel weighs 10 pounds.

B.

Your parcel weighs 10 stones.

C.

Your parcel weighs 10 account.

Full Access
Question # 32

A developer working on a simple web service integration is asked to add appropriate logging to allow future troubleshooting.

According to logging best practices, which code should the developer write to log when an operation succeeds, but has an unexpected outcome that may produce side effects?

A.

Logger.warn( ' Unexpected service response. ' )

B.

Logger.debug( ' Unexpected service response. ' )

C.

Logger.error( ' Unexpected service response. ' )

Full Access
Question # 33

A controller route in the SFRA base looks as follows:

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

function(req,res,next) {

...base code omitted on purpose...

next();

},

pageMetaData.computedPageMetaData

);

In order to extend this route usingprepend(), what should the developer consider?

A.

Specify any middleware functions needed for the new functionality.

B.

Specify any middleware functions needed for the new functionality using only those called by the base route.

C.

Removenext();on the new route so only the route ' s middleware functions execute.

Full Access
Question # 34

Recent code changes to an existing cartridge do not appear correctly on a Storefront. The developer confirms that the code is uploaded in the IDE and ensures that the cartridge is associated with the sandbox.

After checking the Storefront site cartridge path, which step should the developer take to troubleshoot this problem?

A.

Check that the correct code version is selected.

B.

Check that the search index was recently rebuilt.

C.

Check the Business Manager site cartridge path.

Full Access
Question # 35

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?

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.

Full Access
Question # 36

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?

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.

Full Access
Question # 37

Given a B2C Commerce client with these specifics:

Sells in two different countries: US and IN

Uses only the English language

A developer has a requirement to add a new field to the IN registration form that must not appear in the US one.

Which path should be created to accomplish this requirement?

A.

cartridge/forms/en_IN/profile.xml

B.

cartridge/forms/profile_en_IN.xml

C.

cartridge/forms/profile_in.xml

Full Access
Question # 38

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

What is the correct code to accomplish this?

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 >

Full Access
Question # 39

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?

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.

Full Access
Question # 40

A client that sells sport shoes wants to allow its customers to filter products based on the intended activity (such as tennis, jogging, basketball, etc.), but this particular information is not present in the current catalog.

Which two actions does a developer need to perform in a B2C Commerce instance to allow this to happen?

A.

Create a new Product custom attribute AND add a new Search Refinement Definition for the desired categories.

B.

Create a new ProductRefinement custom attribute AND add a new Search Refinement Definition for the desired categories.

C.

Create a new Product custom attribute AND add a new viewtype in the storefront catalog settings.

Full Access
Question # 41

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

A.

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

B.

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

C.

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

Full Access
Question # 42

A developer wants to configure the following products so that same search results are returned regardless of the search term used. The search term can be bag, purse, pocketbook, and tote. How should the developer configure this?

A.

Synonyms

B.

Hypernyms

C.

Hyponyms

Full Access
Question # 43

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

{

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

" methods " :[

" put "

],

" read_attributes " : " (**) " ,

" write_attributes " : " (**) "

}

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

Full Access
Question # 44

Given a template rendered by a controller with caching and a remote include without caching, which situation applies?

A.

The remote include portion is not cached, but the rest of the page is cached.

B.

The page is not cached because the remote include introduces an uncached portion.

C.

The page is cached only for returning customers because of the remote include.

Full Access
Question # 45

Which line of code should a developer add for custom category debug logging?

A.

Logger.customLogger( ' contact ' ).debug( " Contact service responded with OK. " );

B.

Logger.debug( ' Contact service responded with OK. ' );

C.

Logger.getLogger( " contact " ).debug( " Contact service responded with OK. " );

Full Access
Question # 46

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?

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.

Full Access