You need to sign in to do that
Don't have an account?
Vijay Nagarathinam
Database.executeBatch cannot be called from a batch start, batch execute, or future method. error
Hi,
Currently, I am calling a batch class from the trigger.While running the trigger I am getting below error.
Database.executeBatch cannot be called from a batch start, batch execute, or future method.
If anyone know how to resolve this issue. Please let me know.
Thanks,
Vijay
Currently, I am calling a batch class from the trigger.While running the trigger I am getting below error.
Database.executeBatch cannot be called from a batch start, batch execute, or future method.
If anyone know how to resolve this issue. Please let me know.
Thanks,
Vijay
1// BatchClass is the name of batchclass
2BatchClass bh = new BatchClass();
3Database.executeBacth(bh);
My only concern is that the Trigger would fire on the DML events and that would invoke the Batch.Do you want to run batch as many times as the Trigger would fire ??
If this helps,please mark it as best answer to help others :)
Can you post the trigger code so that it is more clear why are you getting this error. Thanks.