Dave Tolls wrote:If you want to continue sending batches after one has failed then you need to put your try/catch closer in, around the executeBatch call.
At the moment it is surrounding the loop, so any exception results in the loop being exited.
I was like
,why the hell I can't think like that. You were just awesome it worked.
Dave Tolls wrote:Also, can I suggest moving all that code in the catch block into a method (at least)?
That's a lot of lines to have in a catch, and makes the code hard to follow. It took several read throughs to actually see where the try/catch sat.
Apology for obscure code. Yes moved catch clause's code in a separate method. I think from next time I should surround only line of codes by try block which may raise exception although I have to create multiple try catch. Thank you so much Dave Tolls and Brian Tkatch