You need to sign in to do that
Don't have an account?
daniel k 4
Apex Batch Job Completed with Failures
Hi All,
I have an apex batch job executed with 1000 batches and 999 are successful but 1 batch failed.
My batch size was 200.
Does this mean all 200 records not processed through this batch job ?
How can I identify the records due to which, batch job is not successful ?
Thanks
D
I have an apex batch job executed with 1000 batches and 999 are successful but 1 batch failed.
My batch size was 200.
Does this mean all 200 records not processed through this batch job ?
How can I identify the records due to which, batch job is not successful ?
Thanks
D
Regards,
Pawan Kumar
Runtime exception messages (which is what the "Developer script execution" emails are about) always get sent to the 'Last Modified By' user of the Apex class that generates the exception. So please check who is the last modified By user and ask them to send the error email.
Regards,
Pawan Kumar
Let's say, I want to create a new apex batch job such that I should be able to capture the erroneous records when any of the batches failes.
In this case how can I handle ?
Thanks
D
You can get sample code here which need to placed in finish method.
https://salesforce.stackexchange.com/questions/17569/best-practices-for-monitoring-scheduled-apex-and-batch-apex
Regards,
Pawan Kumar
Please help in closing by marking best. If it was helpful to you. Thanks.
Regards,
Pawan Kumar
I'm thinking of using stateful and capture the ids, from there I should be able to send the affected id's to my email.
BTW, sending only affected record ids would not be sufficient for your lead/architect/business. you send ids along with exception as well so that any can easily know what was the cause of failure of the record in any environment(stage/prod). Thanks.
So, as in my case, if there are failures in batch job, how these records are handled ?
These 200 records should have gone through the same process as the rest of the records in the batch, but they didn't !
Also, there might be many other jobs depending on this job, in such cases how to proceed? Should we fix immediately and re-run ?
Or ignore these records for now and proceed with other jobs ?
Just want to understand how it is done in the real time
Thanks