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
sonamsonam 

System.AsyncException: Future method cannot be called from a future or batch method: CaseClass.method1(LIST<Id>)

I am trying to write a test class and i get the following error..
I do have a static flag in the trigger class chk the recursive calling of the future class

System.DmlException: Update failed. First exception on row 0 with id 500R0000004VgTGIA0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CaseTrigger_BeforeAfter_InsertUpdate: execution of AfterUpdate

caused by: System.AsyncException: Future method cannot be called from a future or batch method: CaseClass.method1(LIST<Id>)
Venkat PolisettiVenkat Polisetti

@sonam,

I believe, your static class is not working or some how your trigger is executing recursively. As the error stated, you cannot call a future method from another future method. This can happen if you are calling the method recursively. 

Post your consise code so that we know what is happening. Also post your test class.

Thanks,
Venkat
sonamsonam
Thanks.

I checked my code i compared my value to theone in the oldmap and it resolved it.