I need to catch the response of a callout method and insert it into a database. But what the problem is, the callout method called from a trigger.
Therefore, I have to add the annotation @future(Callout=true)
if( appStatusesBelowDocSent.contains(currentAppStatus) )
{
envelopeId = EsignUtil.getEnvelopeId(app.Id);
Docusign.voidEnvelopeAsync(envelopeId,'Application recalled or status is changed to a previous status');
// TODO: I need to update a object with the response of Docusign.voidEnvelopeAsync
}
I can not insert the data inside the voidEnvelopeAsync
in the same transaction with callout.
How can I accomplish that?