You need to sign in to do that
Don't have an account?
Gaurav Sinha 27
Callout in Batch Apex
Hi all Veterans
We have a requirement wherein we have to sync the account record with an external server. In account there would be a checkbox to select to sync, if the checkbox will be selected the sync should be processed asynchronously and after the sync is successfully done the checkbox should be set to false. I would appreciate if someone can help me with the complete code.
Thanks in advance.
We have a requirement wherein we have to sync the account record with an external server. In account there would be a checkbox to select to sync, if the checkbox will be selected the sync should be processed asynchronously and after the sync is successfully done the checkbox should be set to false. I would appreciate if someone can help me with the complete code.
Thanks in advance.
All future methods and Batch Classes are Asynchronous and we can not call an Asynchronous call from an Asynchronous call.
Yes, you can call (A queueable class method acts as a future method) only from the Batch class finish method. You can implement a Queueable class that acts as a Future method and then you can invoke another future method. This is an indirect way of calling a future method from the future method (A queueable class method acts as a future method). But this approach also has a governor limit of 2.
So at max, you can call two future methods. I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi