Which three approaches should a developer implement to obtain the best performance for data retrieval when building a Lightning web component? Choose 3 answers
Lazy loading improves performance by loading data only when needed.
Lightning Data Service (LDS) handles data operations and caching efficiently.
Using {Cacheable=true} on Apex methods enables the Lightning Component framework to cache the method's return value, reducing server round-trips for the same data.
Lightning Web Components Developer Guide
Assuming the CreateOneAccount class creates one account and implements the
Queueable interface, which syntax properly tests the Apex code?
A)
B)
C)
D)
To test Queueable Apex, Test.startTest() and Test.stopTest() should be used to ensure the asynchronous code is executed before assertions are made. After calling Test.stopTest(), you would then query for the records to assert that the queueable job correctly created the Account records. Reference: Apex Developer Guide - Testing Asynchronous Apex
A developer is asked to find a way to store sacret data with an ability to specify which profiles and users can access which secrets.
What should be used to store this data?
Custom metadata types are the optimal way to store secret data that needs to be accessed by certain profiles and users. Access to custom metadata records can be controlled by the Salesforce sharing model. Reference: Salesforce Help - Custom Metadata Types Overview
A Visualforce page needs to make a callout to get billing information and tax information from two different REST endpoints. The information needs to be
displayed to the user at the same time and the return value of the billing information contains the input for the tax information callout. Each endpoint might take up to two minutes to process.
How should a developer implement the callouts?
Using Continuation for both callouts is the optimal solution when you have long-running callouts in a Visualforce page, as it allows the page to wait for a long-running process without tying up server resources. The Continuation pattern is specifically designed for scenarios where the request-response cycle could exceed the timeout limits. Reference: Visualforce Developer Guide -- Continuations
A developer created a Lightning web component for the Account record page that displays the five most recently contacted Contacts for an Account. The Apex method,
Contacts, returns a list of Contacts and will be wired to a property in the component.
Which two lines must change in the above code to make the Apex method able to be wired?
Choose 2 answers
To make an Apex method callable from a Lightning Web Component, you need to annotate the method with @AuraEnabled and mark it as cacheable if it's only retrieving data without modifying it. Additionally, the method must be public to be accessible from the component.
Line 04: Needs @AuraEnabled(cacheable=true) to allow the method to be called from the Lightning Web Component and indicate that the method doesn't modify any data, making it suitable for caching.
Line 09: The method getFiveMostRecent should not be private because private methods cannot be called from a Lightning Web Component. Changing it to public (or default, which is equivalent to public within the same namespace) is required.
Lightning Web Components and Salesforce Data: Developer Documentation
@AuraEnabled Annotation: Apex Developer Guide
Marva
2 months agoUlysses
4 months agoFarrah
5 months agoKiley
6 months agoCassi
7 months agoSkye
7 months agoKatlyn
8 months agoErick
8 months agoCarol
8 months agoMadelyn
8 months agoLaticia
9 months agoRory
9 months agoFrank
9 months agoPaul
9 months agoClorinda
10 months agoJackie
10 months agoLynelle
10 months agoAllene
11 months agoDominic
11 months agoKallie
11 months agoRonnie
11 months agoVal
11 months agoLeslie
12 months agoFelice
1 years agoIdella
1 years agoIsadora
1 years agoAngelica
1 years agoReena
1 years ago