ExamGecko
Home Home / Salesforce / Certified B2B Commerce Developer

Salesforce Certified B2B Commerce Developer Practice Test - Questions Answers, Page 13

Question list
Search
Search

List of questions

Search

Northern Tail Outfitters (NTO) is converting an existing aura component into a Lightning Web Component. The aura component has the following source code:

What is the equivalent of this code in a Lightning Web Component?

A)

B)

C)

D)

A.
Option A
A.
Option A
Answers
B.
Option B
B.
Option B
Answers
C.
Option C
C.
Option C
Answers
D.
Option D
D.
Option D
Answers
Suggested answer: B

Explanation:

The equivalent of this code in a Lightning web component is option B. Option B uses the @api decorator to expose firstName as a public property of the Lightning web component and communicate it with other components or services. The @api decorator is a decorator that marks a property or method as public, which means that it can be accessed by other components or services that use or consume this component. The @api decorator also makes the property reactive, which means that it can track changes and update the component accordingly. In option B, firstName is exposed as a public property using the @api decorator and passed to the child element using an attribute. Option A is incorrect because it uses an invalid syntax for exposing firstName as a public property. The @api decorator should be used before the property declaration, not after it. Option C is incorrect because it uses an invalid syntax for exposing firstName as a public property. The @api decorator should be used with parentheses, not without them. Option D is incorrect because it uses an invalid syntax for exposing firstName as a public property. The @api decorator should be used with camel case, not with hyphens. Salesforce

Reference: Lightning Web Components Developer Guide: Communicate with Properties, Lightning Web Components Developer Guide: Decorators

An administrator has just provided a developer with a completely new org and a username. Assuming the username is [email protected], what is the correct set of steps to authorize the org for Command Line Interface (CLI) access so the developer can deploy Lightning web components?

A.
Run the command: 'sfdx force:login -r 'https://login.salesforce.com'' and supply the credentials in the browser when it opens.
A.
Run the command: 'sfdx force:login -r 'https://login.salesforce.com'' and supply the credentials in the browser when it opens.
Answers
B.
Run the command 'sfdx force:auth:web:login -a 'https://login.salesforce.com''' and then supply the credentials in the browser when it opens.
B.
Run the command 'sfdx force:auth:web:login -a 'https://login.salesforce.com''' and then supply the credentials in the browser when it opens.
Answers
C.
Run the command: 'sfdx force:auth:web:login -r 'https://login.salesforce.com' and then supply the credentials in the ^ browser when it opens ^
C.
Run the command: 'sfdx force:auth:web:login -r 'https://login.salesforce.com' and then supply the credentials in the ^ browser when it opens ^
Answers
D.
Run the command 'sfdx force:auth:web:login -r 'https://login.salesforce.com' -username^'mefaJmy-new-org.org''
D.
Run the command 'sfdx force:auth:web:login -r 'https://login.salesforce.com' -username^'mefaJmy-new-org.org''
Answers
Suggested answer: C

Explanation:

To authorize the org for Command Line Interface (CLI) access so the developer can deploy Lightning web components, the developer should run the command: 'sfdx force:auth:web:login -r ''https://login.salesforce.com'' and then supply the credentials in the browser when it opens. The sfdx force:auth:web:login command is a Salesforce CLI command that authorizes an org using the web server flow. The web server flow is an OAuth 2.0 authentication flow that opens a browser window and prompts the user to log in to Salesforce and allow access to the CLI. The -r flag specifies the login URL of the org, which is https://login.salesforce.com for production or developer orgs. Running this command will open a browser window and ask the developer to enter their username and password for the org. After successfully logging in, the developer will be able to use the CLI to perform various tasks with the org, such as deploying or retrieving metadata, running tests, or executing commands. Running the command: 'sfdx force:login -r ''https://login.salesforce.com'' is not a valid way to authorize the org for CLI access, as there is no such command as sfdx force:login. Running the command 'sfdx force:auth:web:login -a ''https://login.salesforce.com''' is not a valid way either, as the -a flag specifies an alias for the org, not a login URL. Running the command 'sfdx force:auth:web:login -r ''https://login.salesforce.com'' -username'[email protected]'' is not a valid way either, as there is no such flag as -username. Salesforce

Reference:Salesforce CLI Command Reference: force:auth:web:login,Salesforce Developer Tools for Visual Studio Code

A developer needs to import some new product data contained in a JSON file one time. What are two viable ways to do this? .

A.
Convert the JSON to an xlsx file and use Workbench to import it
A.
Convert the JSON to an xlsx file and use Workbench to import it
Answers
B.
Run a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username>
B.
Run a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username>
Answers
C.
Convert the JSON to a CSV file and use Data Loader to import it
C.
Convert the JSON to a CSV file and use Data Loader to import it
Answers
D.
Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username>
D.
Run a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username>
Answers
Suggested answer: B, C

Explanation:

Two viable ways that a developer can import some new product data contained in a JSON file one time are running a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username> and converting the JSON to a CSV file and using Data Loader to import it. Running a command like: sfdx force:data:tree:import -f NewProducts.json -u <your username> allows the developer to import data from a JSON file into an org using Salesforce CLI commands. The sfdx force:data:tree:import command is a Salesforce CLI command that imports data into an org using JSON files that conform to the SObject Tree API specification. The SObject Tree API specification is a format that defines how records are represented in JSON files for data import or export. The -f flag specifies the path of the JSON file that contains the data to be imported. The -u flag specifies the username or alias of the org where the data will be imported. Running this command will create records in the org based on the data in the JSON file. Converting the JSON to a CSV file and using Data Loader to import it allows the developer to import data from a CSV file into an org using Data Loader. Data Loader is a tool that allows users to import or export data between Salesforce and CSV files. The developer can use an online converter or a spreadsheet application to convert their JSON file into a CSV file that matches the structure and format of their Salesforce object. The developer can then use Data Loader to import the CSV file into their org and create records based on the data in the CSV file. Converting the JSON to an xlsx file and using Workbench to import it is not a viable way to import some new product data contained in a JSON file one time, as Workbench does not support xlsx files for data import or export. Workbench is a web-based tool that provides access to various Salesforce features and functionalities, such as data manipulation, REST Explorer, and Apex Execute. Running a command like: sfdx force:data;import:bulk -f NewProducts.json -u <your username> is not a viable way either, as there is no such command as sfdx force:data;import:bulk. The correct command for importing data using bulk API is sfdx force:data:bulk:upsert. Salesforce

Reference: [Salesforce CLI Command Reference: force:data:tree:import], [Salesforce Developer Tools for Visual Studio Code], [Data Loader Guide: Import Data into Salesforce], [Workbench], [Salesforce CLI Command Reference: force:data:bulk:upsert]

A developer has the task to bring some historical data into an org. The data must reside in the org, but cannot be populated in standard or custom objects. The customer is fine with developers building Ul components to surface this data on a case-by-case basis.

Which option allows a developer to meet all of these requirements?

A.
Big objects
A.
Big objects
Answers
B.
Lightning Canvas
B.
Lightning Canvas
Answers
C.
External objects
C.
External objects
Answers
D.
Lightning Out
D.
Lightning Out
Answers
Suggested answer: A

Explanation:

To bring some historical data into an org, the data must reside in the org, but cannot be populated in standard or custom objects, and the customer is fine with developers building UI components to surface this data on a case-by-case basis, the option that allows a developer to meet all of these requirements is big objects. Big objects are a type of object that can store and manage massive amounts of data on the Salesforce platform. Big objects can store up to billions of records and are accessible through a subset of SOQL or custom user interfaces. Big objects are not subject to the same storage limits or performance issues as standard or custom objects and are suitable for storing historical or archived data that does not need to be updated frequently. Big objects can be defined using Metadata API or declaratively in Setup. Lightning Canvas is not an option that allows a developer to meet all of these requirements, as it is a framework that allows developers to integrate third-party applications into Salesforce. Lightning Canvas does not store data in the org, but rather displays data from external sources using an iframe. External objects are not an option either, as they are a type of object that map to data stored outside Salesforce. External objects do not store data in the org, but rather access data from external systems using OData services. Lightning Out is not an option either, as it is a feature that allows developers to use Lightning components outside Salesforce. Lightning Out does not store data in the org, but rather renders components on external web pages or applications. Salesforce

Reference:Salesforce Help: Define Big Objects,Salesforce Help: Lightning Canvas Developer's Guide,Salesforce Help: External Objects,Salesforce Developer Blog: Lightning Out

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

A.
Text Area(Long)
A.
Text Area(Long)
Answers
B.
Picklist (Multi-Select)
B.
Picklist (Multi-Select)
Answers
C.
Lookup Relationship
C.
Lookup Relationship
Answers
D.
Address
D.
Address
Answers
E.
Currency
E.
Currency
Answers
Suggested answer: A, C, E

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

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

Northern Trail Outfitters (NTO) has acquired a company and is looking to manage product data across the org seamlessly. The company has a governance policy to not install any tool or use third-party API applications to export or import the data into Salesforce. However, users have access to Salesforce CLI.

Which set of tasks must a developer perform whento export data from Salesforce or import data into Salesforce?

A.
sfdx force:data:bulk:export -Product2 -all 0 and sfdx force:data:bulk:lmport -f Product2.json -all
A.
sfdx force:data:bulk:export -Product2 -all 0 and sfdx force:data:bulk:lmport -f Product2.json -all
Answers
B.
sfdx force:data;tree:export -Product2 -all q and sfdx force:data:tree:lmport -f Product2.json -all
B.
sfdx force:data;tree:export -Product2 -all q and sfdx force:data:tree:lmport -f Product2.json -all
Answers
C.
sfdx force:tree:data:export -q 'SELECT Id, Name FROM Product2' -u <your username> and sfdx force:tree:data:import -f Product2Json -all
C.
sfdx force:tree:data:export -q 'SELECT Id, Name FROM Product2' -u <your username> and sfdx force:tree:data:import -f Product2Json -all
Answers
D.
sfdx force:data:tree:export -q 'SELECT Id, Name FROM Product2' -u '<your username>' and sfdx force:data:tree:import -f Product2.json -u w<your username>'
D.
sfdx force:data:tree:export -q 'SELECT Id, Name FROM Product2' -u '<your username>' and sfdx force:data:tree:import -f Product2.json -u w<your username>'
Answers
Suggested answer: D

Explanation:

The correct answer for how to export data from Salesforce or import data into Salesforce using Salesforce CLI commands is running a command like: sfdx force:data:tree:export -q ''SELECT Id, Name FROM Product2'' -u ''<your username>'' and sfdx force:data:tree:import -f Product2.json -u ''<your username>''. The sfdx force:data:tree:export command is a Salesforce CLI command that exports data from an org into JSON files that conform to the SObject Tree API specification. The SObject Tree API specification is a format that defines how records are represented in JSON files for data import or export. The -q flag specifies the SOQL query that selects the records and fields to be exported. The -u flag specifies the username or alias of the org where the data will be exported from. Running this command will generate JSON files that contain the data from the org based on the SOQL query. The sfdx force:data:tree:import command is a Salesforce CLI command that imports data into an org using JSON files that conform to the SObject Tree API specification. The -f flag specifies the path of the JSON file that contains the data to be imported. The -u flag specifies the username or alias of the org where the data will be imported to. Running this command will create records in the org based on the data in the JSON file. Running a command like: sfdx force:data:bulk:export -Product2 -all 0 and sfdx force:data:bulk:import -f Product2.json -all is not a correct answer, as it uses invalid syntax and flags for the sfdx force:data:bulk:export and sfdx force:data:bulk:import commands. The correct syntax and flags for these commands are sfdx force:data:bulk:upsert -s Product2 -f Product2.csv -w 10 -u <your username> and sfdx force:data:bulk:status -i <job ID> -u <your username>. Running a command like: sfdx force:data;tree:export -Product2 -all q and sfdx force:data:tree:import -f Product2.json -all is not a correct answer either, as it uses invalid syntax and flags for the sfdx force:data:tree:export and sfdx force:data:tree:import commands. The correct syntax and flags for these commands are sfdx force:data:tree:export -q ''SELECT Id, Name FROM Product2'' -u <your username> and sfdx force:data:tree:import -f Product2.json -u <your username>. Running a command like: sfdx force:tree:data:export -q ''SELECT Id, Name FROM Product2'' -u <your username> and sfdx force:tree:data:import -f Product2Json -all is not a correct answer either, as there is no such command as sfdx force:tree:data:export or sfdx force:tree:data:import. The correct commands are sfdx force:data:tree:export and sfdx force:data:tree:import. Salesforce

Reference: [Salesforce CLI Command Reference: force:data:tree:export], [Salesforce CLI Command Reference: force:data:tree:import], [Salesforce CLI Command Reference: force:data:bulk], [Salesforce Developer Tools for Visual Studio Code]

A developer is working on a storefront and is seeing unexpected Ul behavior in one of the custom Lightning web components (LWCs) their team has built.

How should the developer investigate the issue?

A.
Enable Debug Mode for a storefront user, log in to the storefront, and use Browser Inspection tools and debugger points.
A.
Enable Debug Mode for a storefront user, log in to the storefront, and use Browser Inspection tools and debugger points.
Answers
B.
Enable Debug Mode for a storefront user, load the LWC in Visual Studio (VS) Code, attach to session, and view debug logs in VS Code.
B.
Enable Debug Mode for a storefront user, load the LWC in Visual Studio (VS) Code, attach to session, and view debug logs in VS Code.
Answers
C.
Enable debug logs for a storefront user, log in to storefront and perform action, and view debug logs in Setup.
C.
Enable debug logs for a storefront user, log in to storefront and perform action, and view debug logs in Setup.
Answers
D.
Identify the user, inputs, and failure, then ask Salesforce support to investigate the issue with the custom LWC.
D.
Identify the user, inputs, and failure, then ask Salesforce support to investigate the issue with the custom LWC.
Answers
Suggested answer: A

Explanation:

To investigate the issue of seeing unexpected UI behavior in one of the custom Lightning web components (LWCs) their team has built, the developer should enable Debug Mode for a storefront user, log in to the storefront, and use Browser Inspection tools and debugger points. Debug Mode is a feature that allows developers to debug and troubleshoot custom LWCs in the storefront by disabling performance optimizations and enabling source maps. Source maps are files that map the minified or obfuscated code to the original source code, making it easier to read and debug. To enable Debug Mode for a storefront user, the developer can go to Setup, enter Users in the Quick Find box, select Users, click Edit next to the user name, and select Debug Mode. After enabling Debug Mode, the developer can log in to the storefront as the user and use Browser Inspection tools and debugger points to inspect and debug the custom LWC. Browser Inspection tools are tools that are built into web browsers that allow developers to examine and modify the HTML, CSS, JavaScript, and other aspects of a web page. Debugger points are statements that are added to the JavaScript code of a LWC that pause the execution of the code at a certain point and allow the developer to inspect the values of variables, expressions, and other elements. Enable Debug Mode for a storefront user, load the LWC in Visual Studio (VS) Code, attach to session, and view debug logs in VS Code is not a valid way to investigate the issue of seeing unexpected UI behavior in one of the custom LWCs their team has built, as it is not possible to attach to a session or view debug logs for LWCs in VS Code. Enable debug logs for a storefront user, log in to storefront and perform action, and view debug logs in Setup is not a valid way either, as debug logs do not capture information about LWCs or UI behavior. Debug logs are records of database operations, system processes, and errors that occur when executing a transaction or running unit tests. Identify the user, inputs, and failure, then ask Salesforce support to investigate the issue with the custom LWC is not a valid way either, as it is not a recommended or efficient way of debugging or troubleshooting custom LWCs. Salesforce support may not be able to provide assistance or guidance for custom LWCs that are developed by third-party developers. Salesforce

Reference:B2B Commerce Developer Guide: Debug Lightning Web Components,Lightning Web Components Developer Guide: Debug Your Code,Salesforce Help: Debug Logs

During checkout flow customizations, a developer receives an error on shipping cost calculation integrations with the error code: INSUFFICIENT_ACCESS_OR_READONLY.

What is causing this error?

A.
The storefront user does not have access to the Cart Delivery Method object.
A.
The storefront user does not have access to the Cart Delivery Method object.
Answers
B.
An error has occurred during the cart shipping charge integration.
B.
An error has occurred during the cart shipping charge integration.
Answers
C.
The storefront user does not have access to custom fields on the Order Delivery Method object.
C.
The storefront user does not have access to custom fields on the Order Delivery Method object.
Answers
D.
The cart is no longer in a valid Checkout State.
D.
The cart is no longer in a valid Checkout State.
Answers
Suggested answer: D

Explanation:

The error code INSUFFICIENT_ACCESS_OR_READONLY is caused by the cart being no longer in a valid Checkout State during checkout flow customizations. A cart is an object that represents a collection of products and charges that a customer intends to purchase in the storefront. A cart has a Checkout State field that indicates the current state of the checkout process for the cart. The Checkout State can have values such as Draft, InProgress, Completed, or Cancelled. A cart can only be modified or updated when it is in Draft or InProgress state. A cart cannot be modified or updated when it is in Completed or Cancelled state. If an attempt is made to modify or update a cart that is in Completed or Cancelled state, an error with the code INSUFFICIENT_ACCESS_OR_READONLY will be thrown. This error means that the user does not have permission to edit or delete a record because it is read-only or locked. The storefront user does not have access to the Cart Delivery Method object is not a cause of this error code, as it is not related to the cart checkout state or data modification. The Cart Delivery Method object is an object that stores information about the delivery method selected for a cart in the storefront. An error has occurred during the cart shipping charge integration is not a cause of this error code either, as it is not related to the cart checkout state or data modification. The cart shipping charge integration is an integration that calculates and applies shipping charges to a cart based on various factors such as delivery method, location, weight, volume, etc. The storefront user does not have access to custom fields on the Order Delivery Method object is not a cause of this error code either, as it is not related to the cart checkout state or data modification. The Order Delivery Method object is an object that stores information about the delivery method selected for an order summary in the storefront. Salesforce

Reference:B2B Commerce Developer Guide: Cart Object, [B2B Commerce Developer Guide: Cart Delivery Method Object], [B2B Commerce Developer Guide: Order Delivery Method Object], [Salesforce Help: Common Error Messages]

Based on error emails flowing in, a developer suspects that recent edits made to a checkout flow have created a defect. The developer has data points available to use as inputs in reproducing the scenario.

What should the developer do next?

A.
Open the flow, select Debug, provide the session ID for replay, and select Run.
A.
Open the flow, select Debug, provide the session ID for replay, and select Run.
Answers
B.
Open the flow, select Attach to Live Session, provide the session ID, and select Attach.
B.
Open the flow, select Attach to Live Session, provide the session ID, and select Attach.
Answers
C.
Open the flow, select Debug, provide the Input values, and select Run.
C.
Open the flow, select Debug, provide the Input values, and select Run.
Answers
D.
Open the flow, select Debug with Inputs, provide the Input values, and select Run.
D.
Open the flow, select Debug with Inputs, provide the Input values, and select Run.
Answers
Suggested answer: C

Explanation:

The next step that the developer should do after suspecting that recent edits made to a checkout flow have created a defect and having data points available to use as inputs in reproducing the scenario is to open the flow, select Debug, provide the Input values, and select Run. A flow is a type of application that automates a business process by collecting data and performing actions in Salesforce or an external system. A flow can be used to customize the checkout process in the storefront by defining the steps and logic that are executed when a customer places an order. A flow can be edited or modified using Flow Builder, a point-and-click tool that allows developers to create and manage flows. Flow Builder also provides debugging and testing tools that allow developers to run and troubleshoot flows before deploying them. To debug or test a flow, the developer can open the flow in Flow Builder, select Debug from the toolbar, provide the Input values for the flow variables, and select Run. This will execute the flow in debug mode, which simulates how the flow runs in the org with real data. The developer can use debug mode to verify if the flow works as expected or if there are any errors or issues with the flow logic or actions. Open the flow, select Attach to Live Session, provide the session ID, and select Attach is not a valid next step, as it is not a feature or option available in Flow Builder or Salesforce CLI. Attach to Live Session is a feature that allows developers to attach a debugger to a running Apex session and inspect the state of the code execution. Open the flow, select Debug with Inputs, provide the Input values, and select Run is not a valid next step either, as it is not a feature or option available in Flow Builder or Salesforce CLI. Debug with Inputs is a feature that allows developers to debug an Apex class or trigger with predefined input values and breakpoints. Open the flow, select Debug, provide the session ID for replay, and select Run is not a valid next step either, as it is not a feature or option available in Flow Builder or Salesforce CLI. Replay is a feature that allows developers to replay an Apex log file and inspect the state of the code execution at each line. Salesforce

Reference: [B2B Commerce Developer Guide: Customize Checkout Flows], [Salesforce Help: Flow Builder], [Salesforce Help: Debug Your Flows], [Salesforce Developer Blog: Apex Replay Debugger]

Which two technologies can subscribe to the CommerceDiagnosticEvents event?

A.
Aura Components
A.
Aura Components
Answers
B.
Processes
B.
Processes
Answers
C.
Streaming API
C.
Streaming API
Answers
D.
Lightning web components
D.
Lightning web components
Answers
Suggested answer: A, D

Explanation:

Two technologies that can subscribe to the CommerceDiagnosticEvents event are Aura Components and Lightning web components. CommerceDiagnosticEvents is an event that is fired by Salesforce B2B Commerce when an error occurs in the storefront. CommerceDiagnosticEvents contains information about the error, such as error code, error message, error type, and error details. CommerceDiagnosticEvents can be subscribed by other components or services that want to handle or display the error information in different ways. Aura Components are a type of component that can be used to create custom user interfaces for Salesforce apps. Aura Components can subscribe to CommerceDiagnosticEvents using anaura:handlertag in their markup file. Theaura:handlertag specifies an event name, an action attribute that defines a controller function to handle the event, and other optional attributes. Lightning web components are another type of component that can be used to create custom user interfaces for Salesforce apps. Lightning web components can subscribe to CommerceDiagnosticEvents using an @wire decorator in their JavaScript file. The @wire decorator specifies an event name, a function name that defines a handler for the event, and other optional parameters. Processes are not a technology that can subscribe to CommerceDiagnosticEvents, as they are not related to user interface development or event handling. Processes are automated workflows that execute actions based on certain criteria or conditions in Salesforce. Streaming API is not a technology that can subscribe to CommerceDiagnosticEvents either, as it is not related to user interface development or event handling. Streaming API is an API that allows applications to receive notifications of data changes in Salesforce in near real-time. Salesforce

Reference: [B2B Commerce Developer Guide: Handle Errors], [Aura Components Developer Guide: Handle Component Events], [Lightning Web Components Developer Guide: Communicate with Events], [Salesforce Help: Process Automation], [Salesforce Developer Guide: Streaming API]

Total 221 questions
Go to page: of 23