I want to know how to bypass the trigger in Batch apex code.Actually problem is when we are trying to run the batch apex we are facing some errors i think some triggers are firing.Please help me to stop the triggers when batch is running. Please check my below BatchApex class.
You have two options:
To stop triggers from running during ALL batch contacts add
to your triggers. NOTE This is the hammer method and will stop any trigger with this from running during ANY batch job.
2. Find out where the errors are and fix them. The issue is not that the batch is running it is that the triggers/code is not written properly
You could also add a static property in the batch you provided and for the problematic trigger check that variable and not run if set to true.