You need to sign in to do that
Don't have an account?
SFDC ROCK
Is any another way to call future method in batch apex?
Is any another way to call future method in batch apex? As we know that we can not call from one asynchronous process from another asynchronous process.
For this work around you go through link below
https://developer.salesforce.com/forums/?id=906F0000000AqdVIAS
if(System.IsBatch() == false && System.isFuture() == false){
// make your future call here
}
Just try is that working or not.
Use the platform Event here.
Insert the Platform Event from the Batch class and from Platform Event try to execute the Future Method.
Thanks,
Maharajan.C
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