Valid PDII Dumps shared by ExamDiscuss.com for Helping Passing PDII Exam! ExamDiscuss.com now offer the newest PDII exam dumps, the ExamDiscuss.com PDII exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDII dumps with Test Engine here:
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
Correct Answer: A,B
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. References: Lightning Web Components and Salesforce Data: Developer Documentation @AuraEnabled Annotation: Apex Developer Guide
Recent Comments (The most recent comments are at the top.)
Igris - Jun 27, 2025
Yes Correct answer is option C and D.
Fa3il khayr - Sep 17, 2024
Correct answer is : C and D
Dan - May 22, 2024
Johan007 is right.
Johan007 - Mar 10, 2024
The correct Ans should be - C. Add public to line 04. D. Add @AuraEnabled {cacheable=true) to line 03. As to make any Apex method available for Aura/LWc comp, it must have either of Global/Public Access modifier on Method and Must be @AuraEnabled annotated.
Recent Comments (The most recent comments are at the top.)
Yes Correct answer is option C and D.
Correct answer is : C and D
Johan007 is right.
The correct Ans should be -
C. Add public to line 04.
D. Add @AuraEnabled {cacheable=true) to line 03.
As to make any Apex method available for Aura/LWc comp,
it must have either of Global/Public Access modifier on Method and Must be @AuraEnabled annotated.