I added a static variable named, "firstcall" to my method that gets called from a trigger. (Static Boolean firstcall = false;)Static Boolean firstcall = false;
. That variable is originally set to false but when the method runs it checks it and if false, runs the code. The code then updates this static variable to true. My intention was to prevent it from re-running if it gets called by an update in the same execution context (meaning a field update causes the trigger to fire again when I really don't want that)
If I use execute anonymous to insert 225 records on this object, the method only runs on the first 200.
The trigger fires for each batch.. so the last 25 records is not getting updated.
Is Is there a way I can allow the bulk records to be updated but still add the check?
anyAny input would be greatly appreciated!
thanks! Fred