B2B-Commerce-Developer Practice Test Questions

213 Questions


A developer needs to create a scheduled job in another system to move data into the B2B Commerce org. How can the developer do this without additional third party tools?


A. Install a minimal set of dev tools on a machine such as the Command Line Interface (CLI) and create appropriate scripts to import files containing the data


B. Set up an SFTP server as a waystation, drop the files there using the off-platform job and schedule a job in-platform to process the file


C. Set up WebDAV with SFTP as a waystation, drop the files there using the off-platform job and schedule a job in-platform to process the file


D. Create a job in the org (on-platform) to drop a file of existing data, Use the off-platform machine to generate a file and identify the details between the two, Push the changes to the org's "Import" directory





B.
  Set up an SFTP server as a waystation, drop the files there using the off-platform job and schedule a job in-platform to process the file

Explanation:

Option B is the correct answer because it describes a way to create a scheduled job in another system to move data into the B2B Commerce org without additional third party tools. The developer can set up an SFTP server as a waystation, drop the files there using the off-platform job and schedule a job in-platform to process the file. This way, the developer can use the built-in integration capabilities of the B2B Commerce platform, such as the Windows Integration Service (WIS) or the Integration Job Definitions, to import the data from the SFTP server into the org. The other options are incorrect because they either require additional third party tools, such as WebDAV or CLI, or they do not create a scheduled job in another system, but rather in the same org. References: Creating and editing integration jobs, Create a B2B Commerce Org and Checkout Flow, B2B Commerce on Lightning Experience Developer Guide, B2B Commerce and D2C Commerce Developer Guide

A Developer created a custom field that a project wants to expose on a given page. How does the Developer ensure that the field is available to display on a given page?


A. Override the Service Class that the page uses and update the ServiceManagementin CCAdmin for the given storefront to use this new Service Class.


B. Override the Logic Class that the page uses and update the Service Management inCCAdmin for the given storefront to use this new Service Class


C. Create a new Service Classthat the page uses and update the Service Managementin CCAdmin for the given storefront to use this new Service Class


D. Create a new Logic Class that the page uses and update the Service Managementin CCAdmin for the given storefront to use this new Service Class





A.
  Override the Service Class that the page uses and update the ServiceManagementin CCAdmin for the given storefront to use this new Service Class.

Explanation:

To ensure that a custom field is available to display on a given page, the Developer needs to override the Service Class that the page uses and update the Service Management in CCAdmin for the given storefront to use this new Service Class. The Service Class is responsible for retrieving and setting data for a given page. The Logic Class is responsible for implementing business logic and validation rules for a given page. Creating a new Service Class or Logic Class is not necessary, as overriding an existing one can achieve the same result. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Service Classes, Logic Classes

Which three are considered code units, or discrete units of work within a transaction in the debug logs?


A. Validation rule


B. .Apex class


C. Web service invocation


D. Lightning component load


E. Workflow invocations





B.
  .Apex class

C.
  Web service invocation

E.
  Workflow invocations

Explanation:

In the context of Salesforce debug logs, code units represent discrete units of work within a transaction. Apex classes (B), Web service invocations (C), and Workflow invocations (E) are considered code units as they encapsulate specific operations or sets of logic that can be executed as part of a transaction. Validation rules (A) and the loading of Lightning components (D) are not considered discrete units of work in the same way, as they are part of the declarative interface and front-end framework, respectively. For more details on how Salesforce handles transactions and debug logs, refer to the Salesforce Developer Documentation:Salesforce Developer Documentation on Transactions and Debug Logs.

Which event should be triggered when user facing info, warning or error messages need to be displayed on a Visualforce page?


A. showMessage


B. displayPageMessage


C. displayMessage


D. pageMessage





D.
  pageMessage

Explanation:

The event that should be triggered when user facing info, warning or error messages need to be displayed on a Visualforce page is pageMessage. This event is triggered by the displayPageMessage method of the CCRZ.util class, which is a utility class that provides various helper methods for common tasks. The event can be used to display a message on the page with a specified type, title, and text.

For example, CCRZ.util.displayPageMessage('error', 'Oops!', 'Something went wrong.') will trigger the pageMessage event and display an error message on the page.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Events, Util Class

What is the fastest route to setting up a B2B Commerce Store as a developer?


A. Set up B2B Commerce on Lightning Experience manually


B. Create a new store in the Commerce app


C. Import a previously exported store archive


D. Use sfdx setup scripts





C.
  Import a previously exported store archive

Explanation:

The fastest route to setting up a B2B Commerce store as a developer is to use sfdx setup scripts. Sfdx setup scripts are scripts that use Salesforce CLI commands to automate the creation and configuration of a B2B Commerce store. The scripts can perform tasks such as creating scratch orgs, installing packages, importing data, assigning permissions, and deploying code. The scripts can save time and effort for developers who need to set up a B2B Commerce store quickly and easily. Setting up B2B Commerce on Lightning Experience manually is not the fastest route to setting up a B2B Commerce store, as it involvesmany steps and actions that can be tedious and error-prone. Creating a new store in the Commerce app is not the fastest route either, as it also requires manual configuration and customization of various settings and features. Importing a previously exported store archive is not the fastest route either, as it depends on the availability and quality of the store archive and may not reflect the latest changes or updates. Salesforce References: [B2B Commerce Developer Guide: Set Up Your Development Environment], [B2B Commerce Developer Guide: Create Your Store]

Where is the API-based record creation generally handled in Salesforce B2B Commerce?


A. In the methods available in extension hooks


B. The service-layer responsible for the entity


C. Data creation is not allowed


D. Logic classes that implement the businesslogic for create operations





B.
  The service-layer responsible for the entity

Explanation:

The API-based record creation is generally handled in the service-layer responsible for the entity in Salesforce B2B Commerce. The service-layer is a set of classes that provide methods for interacting with the data layer and performing business logic. Each entity, such as product, cart, or order, has a corresponding service class that handles the create, read, update, and delete operations for that entity. For example, ccrz.ccServiceProduct provides methods for creating and retrieving products. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Service Classes

Which Global JavaScript Object should be extended when writing custom Remote Actions?


A. CCRZ.


B. CCRZ.cc


C. CCRZ.cc_CallContext


D. CCRZ.RemoteInvocation





B.
  CCRZ.cc

Explanation:

The Global JavaScript Object that should be extended when writing custom Remote Actions is CCRZ.cc. This object contains all the Remote Actions that are defined in the cloudcraze managed package, which can be overridden or extended by subscriber code. The object also provides a mechanism for registering custom Remote Actions that can be invoked by the user interface components. For example, CCRZ.cc.customAction = function(params, callback){ // do something } will define a custom Remote Action named customAction that can be called by CCRZ.cc.customAction(params, callback). Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Remote Actions

Which three data types are supported for custom fields while using CSV file format for importing data for a store?


A. Text Area(Long


B. Picklist (Multi-Select)


C. Lookup Relationship


D. Address


E. Currency





A.
  Text Area(Long

C.
  Lookup Relationship

E.
  Currency

Explanation:

Three data types that are supported for custom fields while using CSV file format for importing data for a store are Text Area(Long), Lookup Relationship, and Currency. A custom field is a field that is added by a developer or an administrator to an object to store additional information or data. A data type is a property that defines the type, format, and validation rules of a field. A CSV file is a file format that stores tabular data in plain text using commas to separate values. A store is a record that represents a B2B or B2C storefront in Salesforce. Text Area(Long) is a data type that allows users to enter up to 131,072 characters on separate lines. Text Area(Long) is supported for custom fields while using CSV file format for importing data for a store. Lookup Relationship is a data type that allows users to create a relationship between two objects and select a value from another record. Lookup Relationship is supported for custom fields while using CSV file format for importing data for a store. Currency is a data type that allows users to enter currency values and automatically convert them based on the user’s locale and currency settings.

Currency is supported for custom fields while using CSV file format for importing data for a store. Picklist (Multi-Select) is a data type that allows users to select one or more values from a predefined list of values. Picklist (Multi-Select) is not supported for custom fields while using CSV file format for importing data for a store. Address is a data type that allows users to enter address values and automatically format them based on the user’s locale settings. Address is not supported for custom fields while using CSV file format for importing data for a store.

Salesforce References: [Salesforce Help: Custom Field Attributes], [Salesforce Help: Data Types], [Data Loader Guide: Import Data into Salesforce], [B2B Commerce Developer Guide: Store Object]

What tool can a developer use to investigate errors during development?


A. Commerce Diagnostics Event Logging


B. Checkout Flow Log


C. Support cases


D. Browser dev tools





D.
  Browser dev tools

Explanation:

Browser dev tools are a set of web authoring and debugging tools built into most modern browsers. They allow developers to inspect, edit, and debug the HTML, CSS, JavaScript, and network activity of a web page. They can also provide useful information about errors, warnings, performance, and accessibility issues. Browser dev tools are especially helpful for developing and testing Lightning web components, as they can display the component hierarchy, attributes, events, and slots.

The other options are not correct because:

A. Commerce Diagnostics Event Logging is a feature that enables developers to capture and analyze events that occur during the execution of B2C Commerce code. It can help identify performance bottlenecks, memory leaks, and unexpected behavior. However, it is not a tool that can be used directly by the developer, but rather a service that requires a support request to enable and access.

B. Checkout Flow Log is a log file that shows the details of the checkout flow execution, such as the input and output parameters, the pipeline steps, and the errors and warnings. It can help troubleshoot issues related to the checkout process, such as payment, shipping, or tax calculation. However, it is not a tool that can be used during development, but rather a log file that can be accessed after the checkout flow has run.

C. Support cases are requests for assistance from the Salesforce support team. They can help resolve technical issues, provide guidance, or escalate bugs. However, they are not a tool that can be used to investigate errors during development, but rather a communication channel that can be used after the developer has exhausted other resources.

References:

Browser Dev Tools

Debug Your Lightning Web Components

Commerce Diagnostics Event Logging

[Checkout Flow Log]

Which two statements are accurate about the Cart Item with a Type of Charge?


A. It is created with the Cart Delivery Group Method after the shipping integration


B. It is created with the Cart Delivery Group Method after the freight integration


C. It is linked directly to a Cart Id


D. It is linked directly to a Catalog Id





C.
  It is linked directly to a Cart Id

D.
  It is linked directly to a Catalog Id

Explanation:

Two statements that are accurate about the Cart Item with a Type of Charge are that it is linked directly to a Cart Id and that it is linked directly to a Catalog Id. A Cart Item with a Type of Charge is a special type of Cart Item that represents an additional charge or fee that is applied to a Cart, such as shipping, handling, or tax. A Cart Item with a Type of Charge is linked directly to a Cart Id, which means that it belongs to a specific Cart and can be retrieved or updated along with other Cart Items. A Cart Item with a Type of Charge is also linked directly to a Catalog Id, which means that it references a specific Catalog that contains the products and prices for the store. A Cart Item with a Type of Charge is not created with the Cart Delivery Group Method after the shipping integration or after the freight integration, as these are not related to the creation of Cart Items. The Cart Delivery Group Method is a method that determines how products are grouped into delivery groups based on their shipping methods and addresses. The shipping integration and the freight integration are integrations that calculate and apply shipping costs and freight charges to a Cart or an Order.

Salesforce References: B2B Commerce Developer Guide: Cart Item Object, B2B Commerce Developer Guide: Shipping Integration, B2B Commerce Developer Guide: Freight Integration

A developer needs to bulk export all of the Product data from an org and does not have access to Data Loader or Workbench. However, the Command Line Interface (CLI) is available. Which command allows the developer to accomplish this task?


A. sfdx force:data:treeiexport -q -x export-demo -d /tmp/sfdx-out -p


B. sfdx force:data:tree:export -Product2 -all


C. sfdx force:data:tree:export -o Product?


D. sfdxforce:data:tree:export -h





A.
  sfdx force:data:treeiexport -q -x export-demo -d /tmp/sfdx-out -p

Explanation:

The Salesforce CLI command sfdx force:data:tree:export is used to export data from an org into one or more JSON files1. The -q flag is used to specify the path to a file containing a SOQL query, -x is used to specify the name of the exported file, -d is used to specify the directory where the exported file will be saved, and -p is used to indicate that all records returned by the SOQL query should be exported12. This command allows developers to bulk export data from an org without needing access to Data Loader or Workbench12. Therefore, option A is the correct answer. Please note that the actual SOQL query and the directory path would need to be replaced with the appropriate values for the specific use case.

What are three standard page reference types?


A. standard__app


B. standard__component


C. standard__pageNamed


D. comm_loginPage


E. standard__recordDetailPage





A.
  standard__app

B.
  standard__component

E.
  standard__recordDetailPage

Explanation:

In Salesforce, standard page reference types are used within the Lightning Component framework to reference different types of resources. The types include standard__appfor Salesforce apps,standard__componentfor Lightning components, and standard__recordPageto reference a specific record detail or edit page (not standard__recordDetailPage, but it's implied). Thestandard__pageNamedand comm_loginPageare not standard page reference types recognized by Salesforce. For more details, refer to the Salesforce documentation on PageReference Types:Salesforce PageReference Types Documentation.


Page 4 out of 18 Pages
Previous