exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 375 discussion

Actual exam question from Salesforce's CRT-450
Question #: 375
Topic #: 1
[All CRT-450 Questions]

A developer wrote an Apex method to update a list of Contacts and wants to make it available for use by Lightning web components.

Which annotation should a developer add to the Apex method to archive this?

  • A. @RemoteAction(cacheable=true)
  • B. @AuraEnabled
  • C. @RemoteAction
  • D. @AuraEnabled(cacheable=true)
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Neel_sehgal
5 months, 4 weeks ago
No, you cannot perform update operations in an @AuraEnabled(cacheable=true) method. The @AuraEnabled(cacheable=true) annotation is used to indicate that the method's results can be cached on the client side for performance optimization. This implies that the method must be idempotent and should not change any data. It should be used for read-only operations. To perform update operations, you should use a standard @AuraEnabled method without the cacheable=true attribute. Here’s how you can do it:
upvoted 1 times
...
SS1121
6 months, 1 week ago
Selected Answer: D
https://developer.salesforce.com/docs/platform/lwc/guide/apex-wire-method.html
upvoted 1 times
...
SanjeevOnForce
1 year, 1 month ago
Its B as (cacheable=true) is not required to achieve the request. However, can be added if needed.
upvoted 1 times
...
Cindy_Hr
1 year, 2 months ago
Selected Answer: B
The correct answer is B. Imperative apex method call needs to be anotaded with @AuraEnabled.
upvoted 2 times
...
BrucePark
1 year, 5 months ago
Why not B?
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago