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
AbAb 

FATAL_ERROR caused by: System.AsyncException: Future method cannot be called from a future or batch method:

Hello,

I have below error:
FATAL_ERROR caused by: System.AsyncException: Future method cannot be called from a future or batch method:

for a workarounf, can i do like below
Trigger before update
  Call a future class
     Call API
     DO a Update action

Trigger After update
    Call a future clas
       Call a API

What will be my best configuration to do

What are generic rules , DML, Future how to set them

thank you for suggestion
Best Answer chosen by Ab
Rounak SharmaRounak Sharma
hi Sandrine,

Test that a trigger enqueuing the @future calls is able to handle a trigger collection of 200 records. This helps determine if delays may occur given the design at current and future volumes.
You can’t call a future method from a future method. Nor can you invoke a trigger that calls a future method while running a future method. See the link in the Resources for preventing recursive future method calls.
Minimize the number of asynchronous requests created to minimize the chance of delays.
Use extreme care if you are planning to invoke a batch job from a trigger. You must be able to guarantee that the trigger won’t add more batch jobs than the limit.

Please let me know if it helps you.
Thanks