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
Parteek Goyal 3Parteek Goyal 3 

I want that if trigger is found error on specific record then it should not stop insertion. Is there any way to do this?

Hi All,
I have a after insert trigger on case. which fetch data from contact and update it to case record.
My problem is, sometime it thorwing error due to some reasons and it also stop case insertion.
I want that if trigger is found error on specific record then it should not stop case insertion. Is there any way to do this?

Please help?

Thanks,
Parteek
Anjuna Baby 6Anjuna Baby 6
Are you using Insert statement or Database.Insert for inserting Case records?
  If we use the DML statement (insert), then in bulk operation if error occurs, the execution will stop and Apex code throws an error which can be handled in try catch block.
    If DML database methods (Database.insert) used, then if error occurs the remaining records will be inserted / updated means partial DML operation will be done.
For more details refer here (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm)