SalesforceSalesforce
PDI · Question #99
PDI Question #99: Real Exam Question with Answer & Explanation
The correct answer is B: Calling a method that is not annotated with cacheable-true. This question identifies specific technical conditions under which an Apex method must be called imperatively from a Lightning web component.
Submitted by chiamaka_o· Apr 18, 2026User Interface
Question
Which two scenarios require an Apex method to be called imperatively from a Lightning web component? Choose 2 answer
Options
- ACalling a method that makes a web service callout
- BCalling a method that is not annotated with cacheable-true
- CCalling a method with the click of a button
- DCalling a method that is external to the main controller for the Lightning web component
Explanation
This question identifies specific technical conditions under which an Apex method must be called imperatively from a Lightning web component.
Common mistakes.
- A. While a method making a web service callout must be called imperatively, the fundamental technical reason is that such methods cannot be
cacheable=true; thus, option B provides the more general and direct underlying cause. - C. Calling a method with a button click is a common trigger for imperative invocation, but it is not the underlying technical characteristic of the Apex method itself that necessitates the imperative call. (Methods called this way are often not
cacheable=true, fitting option B).
Concept tested. LWC imperative Apex method invocation
Topics
#LWC Apex Integration#Imperative Apex Call#Wire Service#@AuraEnabled(cacheable=true)
Community Discussion
No community discussion yet for this question.