B2B-Commerce-Developer Exam Questions

Total 213 Questions


Last Updated On : 16-Jan-2025

What are two guidelines for logging that are used within the core Salesforce B2B Commerce product? (2 answers)


A. Items or data within computational intensive loops shouldbe logged.


B. The close method of ccrz.ccLog must be called at the end of the remote action.


C. No calls to ccrz.ccLog can be made before cc_CallContext.initRemoteContext is executed.


D. It is okay to log any data on the server that is already logged on the client side.





B.
  The close method of ccrz.ccLog must be called at the end of the remote action.

C.
  No calls to ccrz.ccLog can be made before cc_CallContext.initRemoteContext is executed.

Explanation:

Two guidelines for logging that are used within the core Salesforce B2B Commerce product are:

The close method of ccrz.ccLog must be called at the end of the remote action. This method will flush the log messages to the browser console or to a custom object, depending on the logging mode. If this method is not called, the log messages may not be displayed or saved properly.

No calls to ccrz.ccLog can be made before cc_CallContext.initRemoteContext is executed. This method will initialize the call context object, which contains information such as the current user, cart, storefront, and configuration settings. These information are required for logging, so calling ccrz.ccLog before initializing the call context will result in an error.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Logging

Which method is used to override when extending the Salesforce B2B Commerce logic providers?


A. doLogic


B. process


C. doAction


D. fetch





C.
  doAction

Explanation:

The method that is used to override when extending the Salesforce B2B Commerce logic providers is doLogic. This method is responsible for executing the business logic for each logic provider class, such as validating inputs, performing calculations, applying rules, or updating data. By overriding this method, the user can modify or extend the existing logic or add their own custom logic.

Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Logic Classes

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.


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.


C. Enable debug logs for a storefront user, log in to storefront and perform action, and view debug logs in Setup.


D. Identify the user, inputs, and failure, then ask Salesforce support to investigate the issue with the custom LWC.





A.
  Enable Debug Mode for a storefront user, log in to the storefront, and use Browser Inspection tools and debugger points.

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 References: B2B Commerce Developer Guide: Debug Lightning Web Components, Lightning Web Components Developer Guide: Debug Your Code, Salesforce Help: Debug Logs

Which two guidelines should a developer consider when migrating aura components to LWC?


A. Migrate one component and then determine whether additional effort would make sense


B. Start with migrating trees of components (components within components)


C. Force all developers to write any new components using Lightning web components


D. Start with simple components that only render Ul





A.
  Migrate one component and then determine whether additional effort would make sense

D.
  Start with simple components that only render Ul

Explanation:

When migrating aura components to LWC, a developer should consider two guidelines: migrate one component and then determine whether additional effort would make sense and start with simple components that only render UI. Migrating one component and then determining whether additional effort would make sense allows the developer to evaluate the benefits and costs of migration and decide whether to continue or stop. Migrating simple components that only render UI allows the developer to leverage the performance and modern features of LWC without much complexity or dependency on other components or services. Starting with migrating trees of components (components within components) is not a good guideline, as it can introduce more challenges and dependencies that can complicate the migration process. Forcing all developers to write any new components using Lightning web components is not a good guideline either, as it can create inconsistency and confusion among developers and users.

Salesforce References: [Lightning Web Components Developer Guide: Migrate Aura Components to Lightning Web Components], [Lightning Web Components Developer Guide: Migration Considerations]

Which two behaviors does a target value of lightning__FlowScreen in metadata allow for a Lightning web component?


A. It allows the Lightning web component to replace standard functionality in flows and subflows


B. It allows the Lightning Web component to be dragged onto a page in Lightning AppBuilder


C. It allows the Lightning web component to be used in guided user experiences to gather input


D. It automatically generates configuration properties for the Lightning web component





C.
  It allows the Lightning web component to be used in guided user experiences to gather input

D.
  It automatically generates configuration properties for the 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 References: Lightning Web Components Developer Guide:

Configure Components for Flows, Lightning Web Components Developer Guide:

Communicate with Flow, Lightning Flow Developer Guide: Screen Components Basics

How is a price group dynamically set?


A. By overriding the ccLogicProductPrice class


B. By using contract pricing


C. By extending the ccApiPriceList API


D. By extending the cc_hk_priceing hook





D.
  By extending the cc_hk_priceing hook

Explanation:

A price group can be dynamically set by extending the cc_hk_pricing hook. This hook allows modifying the price group based on various factors, such as the user, cart, product, or storefront. For example, the hook can apply a different price group for a specific product category or for a specific user segment.

Which two aspects are applicable to Page Includes? (2 answers)


A. Standard Visualforce controls such as apex:form should not be used within a page include


B. Page Includes must be assigned to an OOTB Page, i.e. Home, Product Detail, etc., and enabled


C. Page Includes can be configured as Body Includes Begin.


D. If a controller is used for an included page, then a merge variable must be present on the page.





A.
  Standard Visualforce controls such as apex:form should not be used within a page include

C.
  Page Includes can be configured as Body Includes Begin.

Explanation:

Two aspects that are applicable to Page Includes are: Standard Visualforce controls such as apex:form should not be used within a page include. This is because the page include is rendered inside an existing Visualforce page that already has a form element. Using another form element inside the page include will cause conflicts and errors. Instead, the page include should use HTML elements or custom components that do not require a form element.

Page Includes can be configured as Body Includes Begin. This means that the page include will be rendered at the beginning of the body section of the page, before any other content or widgets. This can be useful for adding some custom content or functionality that applies to the whole page, such as a banner, a modal, or a script. Salesforce References: B2B Commerce and D2C Commerce Developer Guide, Page Includes

What are two purposes of the Shadow DOM in a Lightning web component?


A. It encapsulates the internal document object model (DOM) structure of a web component


B. It allow components to be shared while protecting them from being manipulated by arbitrary code


C. It allows direct access to the document object model of the component


D. It allows older JavaScript libraries to manipulate the tagging structure





A.
  It encapsulates the internal document object model (DOM) structure of a web component

B.
  It allow components to be shared while protecting them from being manipulated by arbitrary code

Explanation:

According to the Lightning Web Components Developer Guide, Shadow DOM is a standard that encapsulates the internal document object model (DOM) structure of a web component. Encapsulating the DOM gives developers the ability to share a component and protect the component from being manipulated by arbitrary HTML, CSS, and JavaScript. Shadow DOM also provides style and behavior isolation for a web component, which means that the styles and scripts defined inside a component do not affect the rest of the page, and vice versa. Therefore, the purposes of the Shadow DOM in a Lightning web component are to encapsulate the internal DOM structure of a web component (A) and to allow components to be shared while protecting them from being manipulated by arbitrary code (B). The other options are incorrect because Shadow DOM does not allow direct access to the document object model of the component ©, nor does it allow older JavaScript libraries to manipulate the tagging structure (D). References: Lightning Web Components Developer Guide, Understand the Shadow DOM Unit

Which interface does a developer have to implement to override Inventory in Checkout?


A. sfdc_commerce.ValidationCartinventory


B. sfdc_commerce.CartinventoryValidation


C. sfdc_checkout.InventoryCartVvalidation


D. sfdc_checkout.CartinventoryValidation





D.
  sfdc_checkout.CartinventoryValidation

Explanation:

To override inventory in the checkout process, a developer must implement thesfdc_checkout.CartinventoryValidationinterface. This interface provides the necessary methods for custom inventory validation logic, allowing developers to define how inventory checks are conducted during the checkout process. Salesforce documentation on extending and customizing the checkout functionality in B2B Commerce would include guidance on implementing this interface to meet specific inventory validation requirements.

A developer attempts to export data from an org by launching Data Loader, selecting a standard entity, clicking the "Select All Fields" button and clicking the Finish button. The developer finds that the CustomField_c field they added to the entity has no values under the header in the CSV file output. What is the root cause?


A. The developer does not have the correct JDK that is recommended by Salesforce and this is known to cause issues with exporting custom attributes


B. The developer does not have access to the object's metadata


C. The field is not populated


D. The user does not have rights to the custom field





D.
  The user does not have rights to the custom field

Explanation:

The root cause of why the CustomField__c field they added to the entity has no values under the header in the CSV file output is that the user does not have rights to the custom field. A user’s access to a field is determined by their profile and permission sets, which define their field-level security settings. Field-level security settings control whether a user can see, edit, or delete the value for a particular field on an object. If a user does not have access to a field, they will not be able to view or modify its value in any interface, including Data Loader. Data Loader is a tool that allows users to import or export data between Salesforce and CSV files. When using Data Loader to export data from an org, Data Loader will only include fields that are accessible to the user based on their field-level security settings. If a user does not have access to a field, Data Loader will not include that field in the CSV file, neither as a column header nor as a value. The developer does not have the correct JDK that is recommended by Salesforce and this is known to cause issues with exporting custom attributes is not the root cause of why CustomField__c has no values under the header in the CSV file output, as it is not related to field access or Data Loader functionality.

The developer does not have access to the object’s metadata is not the root cause either, as it is not related to field access or Data Loader functionality. The object’s metadata defines its structure and properties, such as fields, relationships, and layouts. The field is not populated is not the root cause either, as it contradicts the fact that CustomField__c has no column header in the CSV file output. If the field was not populated but accessible to the user, Data Loader would still include CustomField__c as a column header in the CSV file, but leave its values blank. Salesforce References: Data Loader Guide: Export Data from Salesforce, [Data Loader Guide: Field Mapping], [Salesforce Help: Set Field-Level Security]


Page 7 out of 22 Pages
Previous