In one of my Custom object, there are 4 triggers.( I know, ideally there shuold be one but there are present for long time and we might need some time to correct and put everything in one code)
Coming to question:each trigger executing in multiple contexts. I mean,some of the code in 'each' of them fire in 'before' context as well as some in 'after'context.
I know, there is no guarantee trigger will be executed in particular order. But does that mean for 'each' trigger, both 'before' and 'after' context are executed and then execution of 2nd(another) trigger will start? Or is that we can say, code in all triggers in 'before context' will be executed first( probably in random order) and then code in all triggers in 'after context' will be executed?
For e.g there is one trigger A , a part of code execute in 'before' context' and update field X as true another trigger B fires only if X == true but in 'after' context and create record in another object.
Is there guarantee that above won't create any problem ? i.e before, 2nd trigger(B) check value of X in 'after context', trigger A already would have updated its value to true and record will be safely created in another object?
Can we say before portion of each trigger will be executed first ?