You need to sign in to do that
Don't have an account?

How to handle DML Exception during batch Apex?
Hi,
I wrote a batch Apex job that updates contact records (200 records/batch) by doing a lookup to another table. For the most part, all looks good until a DML Exception occurs. When this happens, none of the records on that batch get updated as expected. My question is: what's the best way to handle this? Can I have a try and catch statement and when the DML Exception is caught, reprocesses all the records within that batch minus the record/records that caused the DML Exception?
Any pointers will be appreciated.
Thanks in advance.
Anyone? :-(