How to prevent a trigger firing during a batch job?
You can use !system.isBatch()
in your trigger to check if it is fired from within a batch or not
System.isSchedulable()
might be a more precise method. System.isBatch()
is true on both Batchable and Queueable jobs.