Salesforce Certified B2B Commerce Developer Practice Test - Questions Answers, Page 11
List of questions
Question 101

What interface must a developer implement to override Tax in Checkout?
Explanation:
To override tax in checkout, a developer must implement the sfdc_checkout.TaxCalculations interface. The sfdc_checkout.TaxCalculations interface is an Apex interface that provides methods for customizing the tax calculation logic for a cart or an order. The interface allows the developer to define how to retrieve tax rates and rules, how to apply tax amounts and adjustments, and how to handle tax errors and exceptions. The developer can use the sfdc_checkout.TaxCalculations interface to integrate with a third-party tax service provider or to implement their own tax calculation logic. The other interfaces do not exist or are not related to tax calculation. Salesforce
Reference:B2B Commerce Developer Guide: Tax Integration,B2B Commerce Developer Guide: Tax Calculations Interface
Question 102

What two things happen with the Cart during tax implementation?
Explanation:
Two things that happen with the cart during tax implementation are that new entries are written to the cart and previous entries are deleted from the cart. A tax implementation is an integration that calculates and applies tax rates and amounts to a cart or an order based on various factors, such as product type, price, quantity, location, and tax rules. A tax implementation can use either an external tax service provider or custom Apex code to perform the tax calculation. When a tax implementation is invoked for a cart, it writes new entries to the cart with a type of Charge and a charge type of Tax. These entries represent the tax amounts and adjustments that are applied to the cart. Before writing new entries to the cart, the tax implementation deletes any existing entries with a type of Charge and a charge type of Tax from the cart. This ensures that the tax calculation is accurate and up-to-date based on the current state of the cart and avoids any conflicts or inconsistencies with previous tax entries. Previous entries are not copied to another object or modified with the new tax calculation, as these are not valid actions for handling existing tax entries. Salesforce
Reference:B2B Commerce Developer Guide: Tax Integration,B2B Commerce Developer Guide: Tax Calculation Flow
Question 103

Which cart item type is created with the Cart Delivery Group Method after the shipping integration?
Explanation:
A cart item with a type of Charge is created with the Cart Delivery Group Method after the shipping integration. A shipping integration is an integration that calculates and applies shipping costs and options to a cart or an order based on various factors, such as product weight, dimensions, quantity, location, and carrier service level. A shipping integration can use either an external shipping service provider or custom Apex code to perform the shipping calculation. The Cart Delivery Group Method is a method that determines how products are grouped into delivery groups based on their shipping methods and addresses. A delivery group is a logical grouping of products that are shipped together using the same shipping method and address. After performing the shipping calculation for each delivery group, the shipping integration creates a cart item with a type of Charge and a charge type of Shipping for each delivery group. These cart items represent the shipping costs and options that are applied to each delivery group. A cart item with a type of Surcharge, Shipping, or Delivery does not exist or is not related to the shipping integration. Salesforce
Reference: [B2B Commerce Developer Guide: Shipping Integration], [B2B Commerce Developer Guide: Cart Delivery Group Method]
Question 104

Ursa Major is planning to implement Salesforce B2B Commerce, and a developer needs to configure taxes for their storefront. The company operates in multiple states, each with different tax rates and tax rules.
What are two ways the developer should configure taxes in B2B Commerce?
Explanation:
Two ways that a developer should configure taxes in B2B Commerce for Ursa Major are: configure a tax engine using third-party software and configure tax rates and rules for each state in Salesforce B2B Commerce. Configuring a tax engine using third-party software allows the developer to integrate with an external tax service provider that can calculate and apply accurate and up-to-date tax rates and rules for different states and jurisdictions. The developer can use the sfdc_checkout.TaxCalculations interface or the RegisteredExternalService object to connect to the third-party tax service provider's API or service. Configuring tax rates and rules for each state in Salesforce B2B Commerce allows the developer to implement their own custom tax calculation logic using Apex code. The developer can use custom objects, such as TaxRate__c and TaxRule__c, to store and manage tax rates and rules for different states and products. The developer can also use the sfdc_checkout.TaxCalculations interface to define how to retrieve and apply tax rates and rules for a cart or an order. Using a different pricebook for each state is not a good way to configure taxes in B2B Commerce, as it can create complexity and inconsistency in pricing and discounting logic. Using the Salesforce out-of-the-box tax calculator is not a good way either, as it does not support complex or dynamic tax scenarios that may vary by state or jurisdiction. Salesforce
Reference: [B2B Commerce Developer Guide: Tax Integration], [B2B Commerce Developer Guide: Tax Calculations Interface], [B2B Commerce Developer Guide: TaxRate Object], [B2B Commerce Developer Guide: TaxRule Object]
Question 105

A developer has been working on the flow of an Inventory Class for checkout. The developer has handled all the error states and now needs to indicate that inventory is available for all items and amounts in the cart.
Which step should happen next?
Explanation:
To indicate that inventory is available for all items and amounts in the cart, the developer should return sfdc.checkout.InventoryStatus.Status.SUCCESS. The sfdc.checkout.InventoryStatus.Status.SUCCESS is a constant value that represents a successful inventory status. It means that the inventory class has checked the availability of all the products in the cart and confirmed that they are in stock and can be fulfilled. The developer should use this value as the return value of the checkInventory method, which is a method that implements the sfdc.checkout.InventoryCheck interface. The checkInventory method is invoked during the checkout flow to validate the inventory availability of the products in the cart. Returning TRUE is not a valid way to indicate inventory availability, as it is not a valid inventory status value. Returning sfdc_checkout.IntegrationStatus.Status.SUCCESS is not a valid way either, as it is not an inventory status value, but rather an integration status value. Returning sfdc.checkout.InventoryStatus.SUCCESS is not a valid way either, as it is not a valid syntax for accessing the inventory status value. Salesforce
Reference:B2B Commerce Developer Guide: Inventory Integration,B2B Commerce Developer Guide: Inventory Status Enum,B2B Commerce Developer Guide: Inventory Check Interface
Question 106

Universal Containers (UC) is ready to build a tax provider class using the interfaces available in the Buyer Experience SDK. When creating a tax provider, what are three things that a developer should consider first?
Explanation:
When creating a tax provider, three things that a developer should consider first are: steps to complete in the tax service, how to handle results, and what to implement. Steps to complete in the tax service are the actions that the developer needs to perform to connect to and use the third-party tax service provider's API or service. These steps may include authentication, authorization, request formatting, response parsing, error handling, and logging. How to handle results are the actions that the developer needs to perform to process and apply the tax calculation results from the tax service to the cart or order. These actions may include creating or updating cart items with type of Charge and charge type of Tax, applying tax adjustments or exemptions, and displaying tax amounts and details on the storefront. What to implement are the methods that the developer needs to define in their custom Apex class that implements the sfdc_checkout.TaxCalculations interface. The interface provides methods for customizing the tax calculation logic for a cart or an order, such as getTaxRatesAndRules, applyTaxAmountsAndAdjustments, and handleTaxErrorsAndExceptions. Whether to use JSON or XML is not something that the developer should consider first, as it is not a critical or relevant factor for creating a tax provider. It may depend on the format that the tax service provider supports or prefers, but it does not affect the overall functionality or performance of the tax integration. What events to fire in the Lightning web component is not something that the developer should consider first either, as it is not related to creating a tax provider. It may be an optional feature that the developer can add to enhance the user interface or user experience of their storefront, but it does not affect the core logic or functionality of the tax integration. Salesforce
Reference:B2B Commerce Developer Guide: Tax Integration, [B2B Commerce Developer Guide: Tax Calculations Interface]
Question 107

A developer is trying to integrate a new shipping provider to use during checkout in a storefront Which two steps must the developer take to make an integration available for selection?
Explanation:
To make an integration available for selection, a developer must create a RegisteredExternalService record using Workbench and create an Apex class that uses the integration framework. Creating a RegisteredExternalService record using Workbench allows the developer to register their custom integration class as an external service in Salesforce B2B Commerce. The RegisteredExternalService record contains information such as the class name, version, display name, description, and category of the integration class. The category determines where and how the integration class can be used in B2B Commerce, such as ShippingService or TaxService. Creating an Apex class that uses the integration framework allows the developer to define custom logic for integrating with an external service provider's API or service. The integration framework provides interfaces and classes for various types of integrations, such as shipping, tax, payment, inventory, and freight. The developer can implement these interfaces and classes in their custom Apex class and override their methods with their own logic. Modifying the StoreIntegratedService to map to an Apex class ID using Workbench is not a required step for making an integration available for selection, as it is only used for registering internal services that are provided by Salesforce B2B Commerce out-of-the-box. Entering the integration class name and version in store administration is not a required step either, as it is only used for selecting an existing integration class that has already been registered as an external service. Salesforce
Reference: [B2B Commerce Developer Guide: Integration Framework], [B2B Commerce Developer Guide: RegisteredExternalService Object]
Question 108

While in the process of gathering requirements from a customer about how they would like to set up their net new storefront checkout experience, a consultant learns that the customer needs the ability to add new shipping and billing addresses during checkout.
Which approach should a developer take to meet this requirement?
Explanation:
To enable the ability to add new shipping and billing addresses during checkout, a developer should enable Buyer Managed Contact Point Addresses within the Shipping Address standard component in the Checkout subflow. The Buyer Managed Contact Point Addresses is a feature that allows customers to add, edit, or delete their shipping and billing addresses during checkout. The developer can enable this feature by setting the buyerManagedContactPointAddressesEnabled attribute to true in the Shipping Address standard component in the Checkout subflow. The Shipping Address standard component is a component that displays and collects the shipping address information for the cart or order. The Checkout subflow is a subflow that defines the steps and components for the checkout process in the storefront. Creating a new shipping address checkout subflow that utilizes the Buyer Managed Contact Point Addresses component is not a valid way to enable this feature, as there is no such component as Buyer Managed Contact Point Addresses. Enabling Buyer Managed Contact Point Addresses within Commerce Administration is not a valid way either, as this feature is not configurable in Commerce Administration. Creating a Lightning web component that enables this functionality and replaces the current shipping address screen within the Checkout subflow is not a valid way either, as this is unnecessary and complicated when there is already a standard component that supports this feature. Salesforce
Reference: [B2B Commerce Developer Guide: Buyer Managed Contact Point Addresses], [B2B Commerce Developer Guide: Shipping Address Component], [B2B Commerce Developer Guide: Checkout Subflow]
Question 109

What is the fastest route to setting up a B2B Commerce Store as a developer?
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 involves many 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
Reference: [B2B Commerce Developer Guide: Set Up Your Development Environment], [B2B Commerce Developer Guide: Create Your Store]
Question 110

Which two behaviors does a target value of lightning__FlowScreen in metadata allow for a Lightning web component?
Explanation:
A target value of lightning__FlowScreen in metadata allows for a Lightning web component to be used in guided user experiences to gather input and to automatically generate configuration properties for the Lightning web component. The lightning__FlowScreen target value specifies that the component can be used on a flow screen, which is a type of flow element that displays information and collects user input in a flow. A flow is a guided user experience that can automate business processes and guide users through screens, actions, and decisions. By using the lightning__FlowScreen target value, the developer can expose their Lightning web component as a custom screen component that can be added to any flow screen. The developer can also use the @api decorator to expose public properties of their Lightning web component as configuration properties that can be set in Flow Builder. Flow Builder is a tool that allows the developer to create and modify flows using a drag-and-drop interface. A target value of lightning__FlowScreen does not allow the Lightning web component to replace standard functionality in flows and subflows or to be dragged onto a page in Lightning App Builder, as these are not related to the flow screen target value. Salesforce
Reference:Lightning Web Components Developer Guide: Configure Components for Flows,Lightning Web Components Developer Guide: Communicate with Flow,Lightning Flow Developer Guide: Screen Components Basics
Question