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
grigri9grigri9 

Is it possible to change trigger error handling behaviour?

I have some custom validation going on whenever someone creates Opportunity Products. I have a trigger that runs after insert that adds errors to any Opp Prods that fail those rules. However, If I throw an error on some records but not others my trigger runs again on the records that did not fail. 

 

 

Is there a way for me to prevent the trigger from running again if there is an error on any of the records? Basically, I want to set the Database.DML all_or_none parameter for people who are saving through the UI.