Activity Forums Salesforce® Discussions Is there a way that batch class send only a single email with all errors' description?

  • Is there a way that batch class send only a single email with all errors' description?

    Posted by Ajit on April 30, 2016 at 3:47 pm

    Running with a problem in batch class where I want if any of the record insertion fails then it should mail the error, but in a case if there are 200 faliures then the batch is sending out 200 emails which is not good, so is there any way that it send only a single email with all the errors' description.

    • This discussion was modified 7 years, 11 months ago by  Ajit.
    • This discussion was modified 7 years, 10 months ago by  Forcetalks.
    • This discussion was modified 7 years, 10 months ago by  Forcetalks.
    • This discussion was modified 6 years, 5 months ago by  Forcetalks.
    Naman replied 7 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Naman

    Member
    April 30, 2016 at 4:00 pm

    You can use stateful in your batch class and for failed record you can send email in finish method.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos