I have a managed app that does a callout (REST API POST) on Account save. The managed app is developed by a 3rd party that we have no control of.
The callout creates a future event which gets an id from the REST API call and saves it in a custom field on the Account object
Now when the id from the REST API is saved to the Account object I want to do another callout to the same REST API to save some more data that the managed app doesn't do.
The problem I am having is because the id that I need from the app callout is set in a future event I can not do another callout because you can not create a future event from with in a future event.
Is there any way around this? Or maybe a different way of solving this problem?
Edit: I'm running out of ideas. I tried executing a batch from my after save trigger and got the following error
System.AsyncException: Database.executeBatch cannot be called from a batch start, batch execute, or future method.
Is the only way around this is to have a scheduled task that runs periodically to do my callout?
@future
) is not allowed to invoke a@future(callout=true)
method? That isn't explicitly excluded in the Future Annotation documentation.