Labour Day Special Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

Salesforce B2C-Commerce-Developer Salesforce Certified B2C Commerce Developer (SP23) Exam Practice Test

Page: 1 / 20
Total 204 questions

Salesforce Certified B2C Commerce Developer (SP23) Questions and Answers

Question 1

A Digital Developer has created a new PaymentForm controller that requires communication with the server and must be made using the HTTPS protocol.

Which code sample should the Developer use to make sure that HTTPS is used?

Options:

A.

exports.PaymentForm = guard.ensure([‘http’, ‘post’, ‘loggedIn’], handlePaymentForm);

B.

exports.PaymentForm = guard.expose([‘post’, ‘loggedIn’], handlePaymentForm);

C.

exports.PaymentForm = guard.httpsPost(handlePaymentForm);

D.

exports.PaymentForm = guard.ensure([‘https’, ‘post’, ‘loggedIn’], handlePaymentForm);

Question 2

When looking at Custom Object instances for a site, a merchant notices that the creation date is not showing up on the instances in Business Manager.

Where should the developer add this attribute to the Custom Object so it is visible for the merchant to see in Business Manager?

Options:

A.

Assign the current date/time to a new custom attribute, creationDate, via code.

B.

Add the creation date to the attributes of the Custom Object.

C.

Mark the existing creation date attribute as visible.

D.

Add the creation date to the attribute group for the Custom Object.

Question 3

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 .properties file.

Question 4

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

What happens in this situation?

Options:

A.

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

B.

Logging is suspended for the day

C.

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

D.

The log file Rolls over and the oldest log messages are overwritten

Question 5

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

Question # 5

Which modification allows the requests to successfully execute?

Options:

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"].

Question 6

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

Options:

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.

Question 7

A client that sells sport shows wants to allow its customers to filer 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 two 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 8

Which two methods are efficient and scalable? (Choose two.)

Options:

A.

ProductMgr.queryAllSiteProducts()

B.

ProductSearchHit.getRepresentedProducts()

C.

ProductSearchModel.getProductSearchHits()

D.

Category.getProducts()

Question 9

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 10

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

component display?

Options:

A.

Base.render = render;

B.

Module.exports.render = render;

C.

Module.exports = render;

D.

Module.exports = server.exports();

Question 11

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

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

Which two XML files should the developer import using the using-specific Merchant Tools import modules?

Options:

A.

Search settings and Promotion

B.

Search settings and Site Jobs

C.

Promotions and Site jobs

Question 12

A developer is tasked with the development of anew Page Designer Page Type, as requested by the merchant.

How should they define the rendering logic of the page?

Options:

A.

Implement a JavaScript file with a render () function.

B.

Implement a metadata JSON file with a ''render'' property.

C.

Implement a Controller file with a ''render'' route.

Question 13

Given the SFRA Controller below:

Question # 13

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

Options:

A.

cache. applyDefauItCache is not a valid middleware.

B.

viewdata is declared but not assigned.

C.

viewdata is assigned but not declared.

D.

viewdata is a B2C Script reserved name.

Question 14

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 15

In Log Center, a developer notes j number of Cross Site Request Forgery (CSRF) log entries.

After adding the token in the 15ML template, which action might solve this problem'

Options:

A.

Add csrfProtection middleware steps in the controller

B.

Extend the CSRF token validity to avoid timeouts.

C.

Delete the existing CSRF allow list in Business Manager.

Question 16

A developer is using logging in scripts to troubleshoot an issue. They are using the dw.system.Log class to write to specific log levels and categories. Which log level is always enabled by default?

Options:

A.

FATAL

B.

INFO

C.

ERROR

Question 17

A client wants to differentiate their monobrand stores with a special icon when shown in the store

locator. The information is saved in a true/false custom attribute for each Store object in Merchant tools.

How should the developer follow SFRA best practices to expose this data for rendering?

Options:

A.

Extend the existing Stores_Find controller with a new middleware function that performs the query

B.

Pass the Store system object to the template, so that custom propierties are available

C.

Ad dan to the template, and call StoreMgr.searchStoresByCoordinates();

D.

Use the module.superModule functionality and the call method to add a new property to the Store Model.

Question 18

What happens if the log file size limit is reached in custom logging?

Options:

A.

Logging is suspended for the day.

B.

Logging is suspended for two hours.

C.

The log file is deleted and recreated from scratch.

D.

The log file rolls over and the last used log is overwritten.

Question 19

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.

Question # 19

What is the result'

Options:

A.

Logs will not be written.

B.

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

C.

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

D.

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

Question 20

In order 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:scss, npm run compile:html, npm run clean

C.

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

D.

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

Question 21

Which technical reports datapoint measures the performance of a controller’s script execution if network factors and Web Adaptor processing is ignored?

Options:

A.

Processing time

B.

Cache hit ratio

C.

Call count

D.

Response time

Question 22

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.

Select the corresponding option in the system preference for Orders.

C.

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

D.

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

Question 23

A Digital Developer selects “Show Orderable Products Only” in the Search > Search Preferences Business Manager module.

Which business goal does this accomplish?

Options:

A.

Exclude products from search results if Available to Sell (ATS) = 0.

B.

Exclude back-ordered products from showing on the website.

C.

Block displaying the product detail page if Available to Sell (ATS) = 0.

D.

Exclude pre-order products from search results.

Question 24

A merchant has a requirement to render personalized content to n a category page via a Content Slot that

targets VIP high-spending customers during a specific promotional period.

Which two items should the developer create to achieve the specified requirements?

Choose 2 answers:

Options:

A.

VIP Customer Group

B.

Page Template

C.

Slot Configuration

D.

Rendering Template

Question 25

A Digital Developer needs to add logging to the following code:

Question # 25

Which statement logs the HTTP status code to a debug-level custom log file?

Options:

A.

logger.getLogger(‘profile’).debug("Error retrieving profile email, Status Code: ", http.statusCode);

B.

logger.debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);

C.

Logger.getLogger().debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);

D.

Logger.getLogger(‘profile’).debug("Error retrieving profile email, Status Code: {0} was returned.", http.statusCode);

Question 26

A developer is asked to periodically create a CSB 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 CommonJ5 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 27

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 producto is {0} with name {1}’, myProduct.getID(), myProduct.getName());

B Logger.warn(‘The current producto is {0} with name {1}’), context(myProduct.getID(), myProduct.getName());

C Logger.warn(‘The current producto is ${myProduct.getID()} with name ${myProduct.getName()}’);

D Logger.warn(‘The current producto is %s with name %s’), context(myProduct.getID(), myProduct.getName());

Options:

Question 28

A Digital Developer added a file named MyBusinessController.js in the cartridge named app_project. The project design calls for this new file to override MyBusinessController.js in client_project. The client_project cartridge contains other necessary functionality. Additional functionality is also included in the storefront_core and storefront_controllers cartridges.

Which cartridge path meets the project requirements?

Options:

A.

client_project:app_project:storefront_controllers:storefront_core

B.

app_project:storefront_controllers:storefront_core

C.

app_project:client_project:storefront_controllers:storefront_core

D.

storefront_core:storefront_controllers:client_project:app_project

Question 29

A merchant checked the "Show Orderable Products Only" preference in Business Manager. What impact does this have on the Storefront from a user perspective?

Options:

A.

Back-order products will be excluded from search results.

B.

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

C.

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

D.

Pre-order products will be excluded from search results.

Question 30

A Digital Developer has a site export file on their computer that needs to be imported into their sandbox.

How should the developer update their sandbox with the data in this file?

Options:

A.

Connect and import the file using the remote option within the Site Import & Export Business Manager module.

B.

Upload and import the file using the local option within the Site Import & Export Business Manager module.

C.

Upload the file to the Impex WebDAV directory and import using the Site Import tool within UX Studio.

D.

Upload the file to the Static WebDAV directory and import using the Import & Export Business Manager module.

Question 31

Which line of code creates a content slot that can be included on homepage.isml to display on the home page?

Options:

A.

B.

C.

D.

Page: 1 / 20
Total 204 questions