You need to sign in to do that
Don't have an account?
HelloSan
how to handle the exception in Order object trigger updating Opportunities
Trigger testOrder on Order (after insert,after update,after delete)
{
//logic
update newopplist //newopplist is list of opportunities
}
How to handle the exception on update newopplist and throw customize error message
{
//logic
update newopplist //newopplist is list of opportunities
}
How to handle the exception on update newopplist and throw customize error message
http://amitsalesforce.blogspot.com/2015/06/trigger-best-practices-sample-trigger.html
If you want to handle the Exception in Trigger . Then please follow below code.
Triggers can be used to prevent DML operations from occurring by calling the addError() method on a record or field. When used on Trigger.new records in insert and update triggers, and on Trigger.old records in delete triggers, the custom error message is displayed in the application interface and logged
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_exceptions.htm
https://developer.salesforce.com/page/An_Introduction_to_Exception_Handling An Introduction to Exception Handling
https://developer.salesforce.com/page/An_Introduction_to_Exception_Handling
Please let us know if this will help you
Thanks
Amit Chaudhary