I have a custom object in which i have two triggers.
Trigger 1( before insert and after update) Trigger 2(After Insert)
Currently whenever i insert a record, trigger 1 fires before i insert the record and trigger 2 fires after it gets inserted.
I tried consolidating the two triggers into 1 trigger . I used the Trigger.isBefore and Trigger.isAfter. The problem i run into is I used the Trigger.isBefore and Trigger.isAfter in if else loop. so it is picking wither one event or the other. But i want it to fire both after is.Before and isAfter for insert. is there way to do it in a single trigger or should i continue to have two triggers.
Appreciate the help in advance
************update*********** I have a recursive check on my triggers because it is going into a infinite loop till it hits the governor limits.so that is the reason i had it before insert events in trigger 1(it will execute only once per operation) and after insert events in trigger 2. I want to move trigger 2 code into trigger 1.
elsestatements... Have you observed differently? If so, please edit your post to include the trigger body.