You need to sign in to do that
Don't have an account?
Shivanath Devnarayanan
DML inside a Batch / Trigger from Batch
I Would like to understand how to keep track of the DML from a batch.
Problem : I have a trigger that marks incoming cases as Unprocessed and then a scheduled batch that processes it and marks it "processed" which in turn fires the trigger
Questions
- Does the static variable way of avoid recursion work for the batch context and the subsequent trigger
- Is the 2nd Trigger in a separate context
- if yes how do i keep track ?
Thanks in advance !
You can use a static variable to determine if your batch job is running. I tried this out really quick and it worked fine:
Class:
Trigger:
The trigger fires fails and the TestBatchClass.isRunning is true.