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

Want to get error when a Batch job failed.
Hi Experts,
I have a requirement to send email to a recient when a batch job gets failed. I want to test it from Developer console. Please help.
Thanks.
Kaity
I have a requirement to send email to a recient when a batch job gets failed. I want to test it from Developer console. Please help.
Thanks.
Kaity
Try with below code,
for more clarification on this go through below link.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database_saveresult.htm
Thanks,
Keyur Modi
Exmaple 2:- http://salesforce.stackexchange.com/questions/34207/custom-error-logging-batch-apex-failure-success-counts
http://salesforce.stackexchange.com/questions/9479/why-does-this-batch-method-fail-every-time
Please let us know if this will help you
Thanks,
Amit Chaudhary
http://www.fishofprey.com/2012/03/salesforce-sending-notification-when.html