function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

sequence of execution of triggers

I have one after trigger and one before trigger on a custom object.
 whin I checked in system log I found that the triggers are executing in the following sequence
First when I Edit a record , before trigger(in which I compare a value from this object to a value in other object and throw an error) is executing and then after trigger(in which I have update statement of other custom object)
and then its going back to before trigger(but the fields which I'm updating are not commited to database) and throwing error message.
is this the sequence or am I missing something.
Any pointers are appreciated...

|The Order of Excecution:

  1. Original record is loaded or initalized
  2. new record field values are loaded and overwrite old values
  3. all before triggers execute
  4. system validation occurs, including custom validation rules
  5. record is saved to the database, but not committed
  6. record is reloaded as required for Apex or workflow
  7. All after triggers execute
  8. workflow rules execute
  9. all DML operations are committed to the database
  10. post-commit logic executes, such as sending emails
Where did you find this in the documentation.
I've read I don't know how many pages? Thousands?