+ Start a Discussion

I have a list of records in that we want to update through trigger in middle 1 record problem then remain records are update or not trigger fire or not?

Best Answer chosen by sultan
Hey ,

I am not clear about the question but I guess you are asking if any error occurs on any record in list while performing DML, whole triggers fail or not?

If this is the case, Please see my answer:

It depends on how you initiated the DML operation. If you directly used standlone operations(insert , delete, update, upsert etc), whole transaction will fail on single record failure.

To avoid this,you can use database methods (database.insert,database.update,database.delete etc..) .These methods allow you to commit the transaction even if you have error on record. So it will skip the records and commit rest of them.

For more info , go through this documentation : https://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_dml_database.htm

Hope this helps!!