A developer is building a custom component in Lightning web components (LWC) that has a grandchild component that needs to pass information to the grandparent component. What is the correct way to demonstrate the passing of a message from the grandchild component to the grandparent component?
A)
B)
C)
D)
What are two considerations to keep in mind when including additional JavaScript files in a Lightning web component?
Answer : B, C
When including additional JavaScript files in a Lightning web component, a developer should keep in mind two considerations: the files must be ES6 modules and must have names that are unique within the component's folder and a module can export named functions or variables. The files must be ES6 modules because LWC uses ES6 modules as the standard for modular JavaScript code. The files must have names that are unique within the component's folder because LWC uses the file name as the module identifier and does not allow duplicate identifiers. A module can export named functions or variables because LWC supports named exports, which allow a module to export multiple values with different names. Each additional file does not need a corresponding .js-meta.xml file, as this is only required for the main JavaScript file of the component. Additional JavaScript files should not be minified before deployment, as this is not necessary or recommended for LWC. Salesforce Reference: [Lightning Web Components Developer Guide: Include JavaScript Files], [Lightning Web Components Developer Guide: ES6 Modules]
Which three statements are true about Global API versioning? (3 answers)
Answer : A, D, E
Three statements that are true about Global API versioning are:
Calling in with an API version set to lower than 1 will result in an exceptional case where the exception class ccrz.BelowMinAPIVersionException will be returned to callers. This exception indicates that the API version is not supported by the framework and the caller should use a higher API version.
The API version is scoped at the Class API level and NOT at the method level. This means that all the methods in a class will use the same API version that is specified by the caller. For example, if the caller passes an API version of 4 to ccrz.ccServiceProduct.getProducts(), then all the other methods in ccrz.ccServiceProduct will also use API version 4.
A developer needs to create an event listener on a parent component programmaticallv. With the script below, what should replace the text
Answer : C
To create an event listener on a parent component programmatically, the developer should use the following line of code:
this.template.addEventListener('notification', this.handleNotification);
This line of code adds an event listener to the template element of the parent component, which is the root element that contains all the child elements. The event listener listens for an event named 'notification', which is a custom event that can be dispatched by any child component. The event listener invokes a method named handleNotification, which is an arrow function defined in the parent component class. The handleNotification method receives the event object as a parameter and can perform any logic based on the event data. The other lines of code are either incorrect or incomplete. Salesforce Reference: Lightning Web Components Developer Guide: Communicate with Events, Lightning Web Components Developer Guide: Create and Dispatch Events
What is default behavior for how theSalesforce B2B Commerce Global APIs transform Salesforce data?
Which handlebars helper expression is used in Salesforce B2B Commerce pages and
components to toggle the display of a block of markup?