Salesforce Platform Developer I (legacy) — Question 156

A developer migrated functionality from JavaScript Remoting to a Lightning web component and wants to use the existing getOpportunities() method to provide data.

Which modification to the method is necessary?

Answer options

Correct answer: C

Explanation

The correct answer is C because Lightning web components require methods to be exposed to the component's JavaScript, which is accomplished by decorating them with @AuraEnabled. Options A, B, and D are incorrect as they do not address the requirement for exposing the method to the Lightning web component framework.