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
bakumbakum 

Where would the trigger error go in this instance?

Hi,

BACKGROUND
I have an approval process on object Marketing_Project__c.  When that approval process ends (either rejected or accepted) I am sending an email to a list of people from a related object.  The way I'm doing this is having the approval update a flag field on the Marketing_Project__c object, and then using a trigger to check for a change to that flag field, and send the emails as needed.  Then the trigger updates the fields back to false.

HERE'S MY QUESTIONS
1) If there's an exception in the trigger will that roll back the approval?
2) If I catch an exception to the field update (at the end of the trigger) what do I do with it?  DO I tell the user?  If so, how?  Trigger.New...that's the field update...not the approval process.  I'm wondering if maybe I should let the exception through to halt the process and get some messaging to me as the sys admin. 

What do you think?