A Northern Trail Qutfitters (NTO) developer made a tile component. To expose a click event and react to user input using the markup below, what should replace <CLICK_EVENT>?
Correct Answer: A
To expose a click event and react to user input in a Lightning web component, the developer should use a method name as the value of the onclick attribute in the template. The method name should be followed by parentheses, as in tileClick(). This syntax indicates that the method is invoked when the element is clicked. The method should be defined in the JavaScript file of the component, and it can access the event object as a parameter. The other options are either invalid or incorrect. For example, {event:tileClick} is not a valid syntax for an onclick attribute, javascript:avoid(0);tileClick(); is unnecessary and outdated, and {tileClick} is a property binding expression, not a method invocation.B2B Commerce and D2C Commerce Developer Guide,Lightning Web Components Developer Guide
Question 57
Which three attributes are true regarding Subscriber pages? (3 answers)
Correct Answer: A,C,D
Three attributes that are true regarding Subscriber Pages are: Subscriber Pages can include additional standard Salesforce B2B Commerce components such as featured products, category tree, and mini cart. These components can be added to the Subscriber Pages by using the CCRZ.pagevars.pageLabels and CCRZ.pagevars.pageSections objects, which contain the page labels and page sections that are defined in CCAdmin. Subscriber Pages allow customers to quickly create new custom pages for their storefront. These pages can be used to display any content or functionality that is not available in the default pages, such as FAQs, testimonials, or promotions. Out of the Box, Subscriber Pages are completely blank HTML pages. These pages do not have any predefined layout or content, so the user can customize them according to their requirements. The user can use Visualforce, HTML, CSS, JavaScript, or any other web technologies to create their own Subscriber Pages. Salesforce B2B Commerce and D2C Commerce Developer Guide,Subscriber Pages
Question 58
Which three are considered code units, or discrete units of work within a transaction in the debug logs?
Correct Answer: B,C,E
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.
Question 59
Which two items are required for a developer to bring picklist values into a Lightning Web Component?
Correct Answer: A,B
To bring picklist values into a Lightning Web Component (LWC), a developer needs to import specific modules from the lwc and lightning/uiObjectInfoApi namespaces. The getPicklistValues function from the lightning/uiObjectInfoApi module is used to fetch the picklist values based on record type and field metadata. Additionally, importing { LightningElement, wire } from lwc is essential for defining the LWC class and using the @wire decorator to wire the getPicklistValues to a property or function. Salesforce documentation on LWC and utilizing the uiObjectInfoApi provides clear guidelines on how to implement this functionality.
Question 60
Which tool should a developer use to author automated tests for custom Lightning web components?
Correct Answer: C
A developer should use Jest to author automated tests for custom Lightning web components. Jest is a powerful tool with rich features for writing JavaScript tests.It is the recommended testing framework for Lightning web components by Salesforce1.Jest allows the developer to write unit tests in local JavaScript files, run them from the command line or Visual Studio Code, and debug them using breakpoints and watch expressions2.Jest also provides features such as mocking, code coverage, snapshots, and asynchronous testing3. Option A, Option B, and Option D are incorrect because they are not testing tools, but rather development tools.Visual Studio Code is an integrated development environment (IDE) that supports Lightning web components development with extensions and plugins4.Salesforce CLI is a command line interface that allows the developer to create, deploy, and manage Lightning web components projects5. Salesforce Developer Console is a web-based tool that provides code editing, debugging, and testing features for Apex and Visualforce, but not for Lightning web components.Reference: Test Lightning Web Components Write Jest Tests Jest Documentation Visual Studio Code Salesforce CLI [Salesforce Developer Console]