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
NTPNTP 

Batch class from a trigger, Good practice?

Hi,

 

Is calling a batch class from a trigger best practice?

 

Thanks in Advance

Bindhyachal Kumar SinghBindhyachal Kumar Singh

Hi NTP,

 

I think calling a batch from trigger is not a good practice. It can exceed limit of batch execution.

Bhawani SharmaBhawani Sharma
Nope, it's not a good practice. Better option is if you execute your batch class once from developer console and call the same batch again using a scheduler from Batch finish method. in start method, you can select all the records modified in specific time period and process them.