Salesforce Certified Platform Developer II — Question 160
Which two scenarios require an Apex method to be called imperatively from a Lightning web component? (Choose two.)
Answer options
- A. Calling a method that makes a web service callout
- B. Calling a method that is not annotated with cacheable=true
- C. Calling a method with the click of a button
- D. Calling a method that is external to the main controller for the Lightning web component
Correct answer: B, C
Explanation
The correct answers, B and C, indicate scenarios where imperative calls to Apex are necessary. Option B is correct because methods without the cacheable=true annotation cannot be called declaratively. Option C is also correct as button clicks require imperative calls to execute Apex methods, while the other options do not necessarily indicate the need for imperative invocation.