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
Muni12345Muni12345 

In trigger there have some piece of code after addError method , how it will be execute?

Hi,

I have some confussion, In trigger there have  some piece of code with after addError method , how it will be execute?

Please give me the solution,

Thanks in advance
GarryPGarryP
you cannot execute any other logic after adderror method. This should always be your last statement in logic which should be displayed in case there is an error while processing. addError (errorMsg) Marks A Record With A Custom Error Message And Prevents Any DML Operation From Occurring.
You can handle error in such case. do your logic and than display a message.
Can you elaborate a little why you need to execute the logic even after some error has been occured in trigger processing?