Questions tagged [cacheable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
44 views

Too many DML statements: 1 in LWC, even when using imperative call

I am creating a LWC that has a data table where you can check some boxes, and then a button that should update a particular field on those rows. Nothing crazy. But I am getting this error: System....
Chris's user avatar
  • 51
1 vote
4 answers
8k views

Issue with @AuraEnabled(cacheable=true)

I had an apex method with @AuraEnabled(cacheable=true) and a wire method in LWC, all was working fine. Then to meet the new requirement I was experimenting with @AuraEnabled(cacheable=false). With ...
Anton Solomin's user avatar
2 votes
1 answer
581 views

Lightning: Need help understanding @AuraEnabled(cacheable=true)

Going through the Developer Guide I found this statement. To set cacheable=true, a method must only get data. It can’t mutate data. Does data mutation only refer to DML operations? I have a method ...
Prapti's user avatar
  • 45
2 votes
1 answer
561 views

How the framework knows that the cached data is stale?

I am wondering on how the framework understand that the data is stale when we use the annotation cacheable=true. Will the framework looks for a change in the timestamp of each record?
Bforce's user avatar
  • 6,774
0 votes
1 answer
152 views

Previously annotated identifier with @AuraEnabled(cacheable=true) must still be annotated: AuraEnabled(cacheable=true)

I am getting this error when I tried to remove the cacheable=true from the below method. @AuraEnabled(cacheable=true) global static boolean packageNotExpired() { /// my code; } Previously ...
Rahul Gawale's user avatar
  • 11.8k
1 vote
1 answer
3k views

Possible Workaround to perform DML when cacheable is true

According to documentation, it is recommended to make wired apex calls from LWC cached, by adding the following annotation to the controller's method: @AuraEnabled(cacheable=true) However, adding ...
Sagnik's user avatar
  • 575
0 votes
1 answer
1k views

Custom related list Lightning component for History table related list - delay in fetching

I created a Custom related list (Component A) that fetches history table and displays. It has a button to refresh the history list. In the same page, I have another lightning component (Component B) ...
Raja Vivekanandhan's user avatar
5 votes
1 answer
13k views

LWC: Does @AuraEnabled(cacheable=true) cache the result individually or combined?

Prequel: I have several methods in need of the same @wire operations. The approach I initially took was to make a new utilities component just for the wire operations and then use the pubsub library ...
Arthlete's user avatar
  • 4,773