Skip to main content

Questions tagged [cacheable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
189 views

How to call a method that makes DML and after that another method to get data and cache it

I have a LWC component, I want to get data of page-layout assigned to user's profile and the fields in the layout. For custom profiles they won't have 'View setup' permission which is needed to get ...
Man0har1919's user avatar
1 vote
1 answer
522 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
  • 61
3 votes
4 answers
17k 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
784 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
4 votes
1 answer
779 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,838
0 votes
1 answer
179 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
  • 12.2k
2 votes
1 answer
4k 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
  • 615
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
14k 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,957