Exam PDII Topic 1 Question 154 Discussion
Actual exam question for Salesforce's PDII exam
Question #: 154
Topic #: 1
Question #: 154
Topic #: 1
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 geyFetchLeadList whencertain 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 3 answers

A developer created a JavaScript function as part of a Lightning web component (LWC) that surfaces information about Leads by wire calling geyFetchLeadList whencertain 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 3 answers
Suggested Answer: A,B,E Vote an answer
The three changes that the developer should implement in the Apex class to ensure the LWC can display data efficiently while preserving security are to annotate the Apex method with @AuraEnabled, implement the with sharing keyword in the class declaration, and annotate the Apex method with @AuraEnabled(Cacheable=True). The @AuraEnabled annotation allows the Apex method to be called from a Lightning web component, and exposes the method to the Lightning Data Service. The with sharing keyword enforces the sharing rules and permissions of the current user when accessing the records, and ensures that the data is secure and compliant. The @AuraEnabled(Cacheable=True) annotation enables the Apex method to be cached by the Lightning Data Service, and improves the performance and efficiency of the data retrieval. Implement the without keyword in the class declaration is not a valid answer, as it ignores the sharing rules and permissions of the current user when accessing the records, and compromises the data security and compliance. Use the WHERE clause within the SOQL query is not a valid answer, as it is not a change in the Apex class, and it does not affect the security or efficiency of the data display. Reference: [Call Apex Methods], [Using the with sharing or without sharing Keywords], [Improve Performance with Storable Actions], [Apex Developer Guide]
by Bertha at Aug 26, 2026, 08:05 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).