You need to sign in to do that
Don't have an account?
Azeez Thummalapalli
Unable to perform DML in Continuation Callback method when calling from Lightning Component
I am trying to use Continuation concept for making Asynchronous webservice call from Lightning Component.
As per the syntax given in documentation, I have annotated the continution method with
and callback method as just
When trying to execute this from UI, I am getting the below error message:
If I add 'cacheable=true' to callback method, then I am unable to perform DML opeartion in it. Ideally, after completing webservice call we must be able to perofrm DMLs, and this works in VFpage but not in Lightning Component.
Could you please suggest any solution or workaround. Thank you in advance.
As per the syntax given in documentation, I have annotated the continution method with
@AuraEnabled(continuation=true)
and callback method as just
@AuraEnabled
When trying to execute this from UI, I am getting the below error message:
Error message: Apex methods that are to be cached must be marked as @AuraEnabled(cacheable=true)
If I add 'cacheable=true' to callback method, then I am unable to perform DML opeartion in it. Ideally, after completing webservice call we must be able to perofrm DMLs, and this works in VFpage but not in Lightning Component.
Could you please suggest any solution or workaround. Thank you in advance.
Azeez Thummalapalli
As a workaround, create a separate Apex method to perform DMLs and invoke that from Javascript method from which the continuation call is originated/initiated.