Weekend Sale Special - 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 75only

Salesforce Comm-Dev-101 Salesforce Certified B2C Commerce Developer Exam Practice Test

Demo: 46 questions
Total 154 questions

Salesforce Certified B2C Commerce Developer Questions and Answers

Question 1

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 2

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?

Options:

A.

Create the custom script in Business Manager.

B.

Define the custom script in the code.

C.

Write the logic to handle the custom script.

Question 3

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?

Options:

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.

Question 4

Given a site called RefArch with the settings shown, what must be done for RefArch to use the same customer list as RefArchGlobal?

Options:

A.

Import the RefArchGlobal customer list into the RefArch site.

B.

Enable " Customer List Sharing " in Global Preferences.

C.

Select RefArchGlobal in the dropdown for Customer List.

Question 5

There is a business requirement that a custom controller in app_custom_my_cartridges invokes the calculateTax function of the dw.order.calculateTax hook that is defined in app_storefront_base. How can the developer implement this call?

Options:

A.

Use:dw.system.HookMgr.callHook( ' dw.order.calculateTax ' , ' calculateTax ' ,currentBasket);

B.

Add the location of the dw.order.calculateTax hook to hooks.json, and then usedw.system.HookMgr.callHook(...).

C.

Add the location of the dw.order.calculateTax hook to package.json, and then usedw.system.HookMgr.callHook(...).

Question 6

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 7

A developer is asked to improve a page ' s maintainability by reducing its code repetition.

Which technique should the developer implement to achieve this?

Options:

A.

Implement template decorators paired with replace tags.

B.

Require and render templates with < isscript > tags.

C.

Embed partial files using ISML expressions.

Question 8

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?

Options:

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.

Question 9

A new product has been added to the Storefront catalog that is assigned to a site.

Which configuration does a developer need to ensure to have a new product visible in the Storefront?

Options:

A.

The search index is built AND the product is online and searchable.

B.

The product has a master product AND the search index is built.

C.

The product has a price AND the product is online and searchable.

Question 10

Given a job step configured in the steptype.json that calls a script module, a developer needs to add a custom status code " NO_FILES_FOUND " in the script. The status does not represent an error condition.

Which code snippet completes this requirement?

Options:

A.

this.status= ' NO_FILES_FOUND ' ;returnthis;

B.

varStatus=require( ' dw/system/Status ' );returnnewStatus(Status.OK, ' NO_FILES_FOUND ' );

C.

varstatus={success: ' OK ' ,message: ' NO_FILES_FOUND ' };returnstatus;

Question 11

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 12

There is a business requirement to allow a third-party warehouse management system to update the MySample.com storefront product inventory in real time. The architect decided that this is most easily accomplished by using the Open Commerce API (OCAPI). The developer needs to test the OCAPI settings in their sandbox. Assume the client ID for testing is " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " . What is the correct OCAPI setting for this?

Options:

A.

Type:Data,Context:Global{ " _v " : " 20.4 " , " clients " :[{ " client_id " : " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " , " allowed_origins " :[ " http://www.example.com " ], " resources " :[{ " resource_id " : " /inventory_lists/* " , " methods " :[ " get " , " put " , " patch " ], " read_attributes " : " (**) " , " write_attributes " : " (**) " }]}] }

B.

Type:Shop,Context:MySample{ " _v " : " 20.4 " , " clients " :[{ " client_id " : " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " , " allowed_origins " :[ " http://www.example.com " ], " resources " :[{ " resource_id " : " /product/*/inventory " , " methods " :[ " get " , " put " , " patch " ], " read_attributes " : " (**) " , " write_attributes " : " (**) " }]}] }

C.

Type:Data,Context:Global{ " _v " : " 20.4 " , " clients " :[{ " client_id " : " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa " , " allowed_origins " :[ " http://www.mysample.com " ], " resources " :[{ " resource_id " : " /product/*/inventory " , " methods " :[ " get " , " put " , " patch " ], " read_attributes " : " (**) " , " write_attributes " : " (**) " }]}] }

Question 13

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 14

A developer is inspecting the weekly service status report for a critical internally-hosted web service and notices there are too many instances of unavailability.

Which solution can reduce service unavailability?

Options:

A.

Increase the web service time out.

B.

Change the code that sets the throwOnError attribute of the service to be true.

C.

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

Question 15

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?

Options:

A.

cartridge/forms/en_IN/profile.xml

B.

cartridge/forms/profile_en_IN.xml

C.

cartridge/forms/profile_in.xml

Question 16

A developer wants to create a Business Manager extension with the cartridge named plugin_bm_extension.

Which two steps should the developer take for the extension option to show up in Business Manager?

Options:

A.

Add custom_bm_extension to the cartridge path under business manager cartridge site path AND add the appropriate roles and permissions to the user to view the business manager extension.

B.

Add custom_bm_extension to the cartridge path under Storefront cartridge site path AND add plugin_bm_extension to the cartridge path under business manager cartridge site path.

C.

Add the appropriate roles and permissions to the user to view the business manager extension AND activate a new code version for the Business Manager site.

Question 17

A developer is asked to create a new service instance that will call a remote web service.

Which method should the developer use to create the service instance?

Options:

A.

dw.svc.LocalServiceRegistry.createService()

B.

dw.svc.LocalServiceInstance.createService()

C.

dw.svc.LocalServiceRegistry.getDefaultService()

Question 18

A developer has a sandbox with code to log a message during execution, and the following code:

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

Logger.info(message);

After the code executes, the developer does not see any log file with the message in the WebDAV folder.

What could the developer do to correct this issue?

Options:

A.

Set the root log level to debug AND check the box for Info under Log Files.

B.

Set the logging global preference to true AND set the root log level to debug.

C.

Set the logging global preference to true AND check the box for Info under Log Files.

Question 19

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 20

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 21

A developer uses hooks for an extension point. Which is true for running multiple hooks for an extension point?

Options:

A.

It is possible to register multiple modules to call for an extension point in a single hooks.json file.

B.

It is possible to control the order in which registered modules are called.

C.

If you call multiple modules, only the first hook called returns a value.

Question 22

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

Question 23

Business Manager has the configuration:

• Active Log category is " root "

• Log level of INFO

The code below executes.

varlog=Logger.getLogger( " products " , " export " );

log.info( " This is important information " );

Using this information, what is the beginning of the filename in which the log will be written?

Options:

A.

products

B.

custom-products

C.

custom-export

Question 24

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

Options:

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.

Question 25

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 26

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?

Options:

A.

Storefront Toolkit

B.

Reports and Dashboards module

C.

Pipeline Profiler

Question 27

A Storefront is designed so that multiple pages share a common header and footer layout.

Which ISML tag should a developer use on the templates for these pages to avoid code repetition in the most effective way?

Options:

A.

< isdecorate > ... < /isdecorate >

B.

< isreplace > ... < /isreplace >

C.

< isinclude > ... < /isinclude >

Question 28

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 29

Given the requirements:

• To integrate with an external web service using HTTP requests.

• To create a service for this purpose with the Service framework using the LocalServiceRegistry class.

• To test the service before the external service provider makes the API available.

Which solution allows the developer to satisfy the requirements?

Options:

A.

Create a service and a Sitepreference that induce the service to respond with a mock response using a conditional.

B.

Create a service and implement the mockFull callback and a sitepreference to enable or disable the mock response.

C.

Create a service and implement the mockFull callback and set the service mode to mock.

Question 30

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 31

A developer has these requirements for out-of-stock products:

• Save the SKUs of the out-of-stock products that the customer is interested in.

• Save the customer email regardless if the customer is a guest or registered.

• Email the customer when the product is back-in-stock.

Which step should the developer perform as part of the solution to achieve the requirements?

Options:

A.

Create a new set-of-string type custom attribute to the system object type Profile to save all the SKUs and use the existing email field for the email.

B.

Create a new set-of-string type custom attribute to the system object type Product to save all the customer email addresses for back-in-stock notification.

C.

Create a new custom object type that has a set-of-string type custom attribute for the SKUs and a string for the email field.

Question 32

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 33

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 34

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

Options:

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.

Question 35

An instance has custom logging enabled. The log reaches the file size limit.

What happens in this situation?

Options:

A.

The current log file is archived and a new log file is created.

B.

The log file is deleted and a new log file is created.

C.

Logging is suspended for the day.

Question 36

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

Options:

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

Question 37

A client has two B2C Commerce sites in the same instance: one for the U.S. market, the other for the European market. They offer free gift wrapping on a selection of products. For each order, five products can be wrapped in the U.S., but only three products can be wrapped in the European region.

How should a developer allow the merchant to independently adjust this number?

Options:

A.

Create a new custom preference by extending the Site Preference object type.

B.

Configure a new localizable content slot with a market-specific value.

C.

Add a new Campaign using the Online Marketing section of the Business Manager.

Question 38

A developer is given the requirement to add a step to the existing business logic of the registration process.

How should the developer modify the route that handles the customer registration?

Options:

A.

Change the controller route with new functionality.

B.

Copy the code from the original route to a new controller route, and change it.

C.

Extend the route with new functionality.

Question 39

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 40

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 41

A custom cartridge that seemed to be performing well in a sandbox has been installed in production. The production instance is showing increased page load times that seem to be related to the new custom code. What can a developer do to quickly track down the potential problem?

Options:

A.

Use the Code Profiler in production instance. Set the mode to Development Mode and then wait a few minutes to collect data from onsite traffic. Click the refresh button to see the new data.

B.

Use the Code Profiler in production instance. Set the mode to Development Mode and click the refresh button to see the new mode displayed.

C.

Use the Code Profiler in a sandbox instance. Set the mode to Extended Development Mode and then load the suspected pages and run the suspected processes several times. Click the refresh button to see the new data.

Question 42

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?

Options:

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.

Question 43

How might a developer resolve the issue of low-stock items appearing at the top of search results?

Options:

A.

In Business Manager, set an availability low ranking threshold in Search Preferences.

B.

In Business Manager, enter a higher boost factor for availability in Searchable Attributes.

C.

Create a job that sets all unavailable products to be hidden. Schedule the job to run hourly to clean up the catalog on a regular basis.

Question 44

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

Options:

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.

Question 45

A developer working on a multi-country site is asked to store country-specific data that drives the creation of a country selector. Examples of the data stored are:

• Pricebook to be used

• Image URL for country flag

The data used in staging also applies in production, but only for this site.

Which approach should the developer take to implement these requirements?

Options:

A.

Extend the Locale System Object to contain the custom data for each country.

B.

Create a replicable, site-specific Custom Object with the custom data for each country.

C.

Create site-specific content assets to store the data for each country.

Question 46

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.

Demo: 46 questions
Total 154 questions