2

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 to retrieve multiple records but I need to return them as a list of Wrapper objects. So I am running the retrieved records through a FOR loop. Would this be considered as altering the data? Would the method not cache the results on the client in this case?

If so, is there another approach to this?

1 Answer 1

2

The restriction is only about making permanent database changes, such as a DML statement, calling a future method, etc. Modifying data in memory is allowed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .