Salesforce
PDII · Question #278
Refer to the following code snippet: A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling getFetchLeadList when…
The correct answer is A. Use the WITH SECURITY_ENFORCED clause within the SOQL query. B. Annotate the Apex method with @AuraEnabled(Cacheable=true). C. Implement the with sharing keyword in the class declaration. See the full explanation below for the reasoning.
Question
Refer to the following code snippet:
A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling getFetchLeadList when certain criteria are met. Which three changes should the developer implement in the Apex class above to ensure the LWC can display data efficiently while preserving security? (Choose three.)
Exhibit
Options
- AUse the WITH SECURITY_ENFORCED clause within the SOQL query.
- BAnnotate the Apex method with @AuraEnabled(Cacheable=true).
- CImplement the with sharing keyword in the class declaration.
- DAnnotate the Apex method with @AuraEnabled.
- EImplement the without sharing keyword in the class declaration.
How the community answered
(61 responses)- A72% (44)
- D18% (11)
- E10% (6)
Community Discussion
No community discussion yet for this question.
