function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vijay NagarathinamVijay Nagarathinam 

Future method issue

Hi,

How to call from one future method to another future method. I'm getting the below exception.

Future method cannot be called from a future or batch method:

Is there any workaround resolve this issue? Please let me know how to fix this issue.

Thanks,
Vijay
SaurabhGupta_SaurabhGupta_

Hi Vijay,

You cannot call a future method via a future method.
To do this you can modify the first class from where you are calling the 1st future class.
Call the 2nd future class also from the inital class and check some condition in 2nd future class to make sure that 1st future has been executed.

Thanks,

Saurabh

Vijay NagarathinamVijay Nagarathinam
Hi Saurabh,

Thanks for your response. Currently, I am using if the 1 future class is finished then enable one checkbox as true. In the 2 future, i am checking the checkbox = true or not. If the value as true then 2 future methods will be a call.

Here the 1 and 2 future methods are used in the same trigger. 

Thanks,
Vijay