This is a question I have always wondered. I have a series of classes and methods that modify the Trigger.new case list records as the list is handed off to each class and method.
Apex goes down the lines of classes and methods synchronously in the trigger. I assume after each class and method changes trigger.new (field values updated, etc.), it then hands the new list of case records to the next class and method(s) and so on.
I assume the original unmodified trigger.new list is not handed to the next class or method, the modified one in is.
That is my understanding of how the transaction works. I ask this to prevent my cobweb of classes and methods from becoming too dependent on the order of execution within each trigger context variable.
trigger CaseTrigger on Case (before insert) {
if(Trigger.isBefore) {
if(Trigger.isInsert) {
QualifyCase.QualifyRecordType(Trigger.new);
ProcessCase.ConvertChars(Trigger.new);
RouteCase.DetermineOwner(Trigger.new);
}
}
}
trigger.new
? – Mahmood May 3 '17 at 21:56