Batch Email

I currently run a batch for our bar-coding (DRS). It fires off every 1 minute and processes what it needs to then finishes (or falls over if there is a problem). I would really like to be able to turn the email me option on with this so that I can find out when it has fallen over. I need to be able to change the batch email setup (for this particular job not the other batch ones) so that it only emails when it fails. Otherwise I would get spammed over 1 minute with successful completion of batches. The other way to do this I would of though would be to have the batch server not check all the time, but to just know when something has been entered into it and fire off… I thought this was possible but may be wrong. If the jobs sucessful you normally get: Status 'Ended' Started on 24/10/2005, at 04:00:11. Finished on 24/10/2005, at 06:01:24. Please check the infologue for more information. New job status 'Waiting'. Job is set to start on 25/10/2005, at 04:00:00. (and i dont want to recieve these) if it fails i would like to see: Status 'Error' Started on 19/10/2005, at 20:19:59. Finished on 19/10/2005, at 20:20:10. The system logged one or more errors, please check the infologue for more information. Plus is it actually possible to attach the error infologue to the email?? any help you could give would be greatly appreciated, thanks. Andrew

Andrew, Per batch job you have the option to get a reply by email every time the batch job has ran. This is standard Axapta. You have to indicate your e-mail address in Human Resources > Employee > Contact Info tab, for the emplyee account that starts the batch job and make sure that the employee id is linked to the user id (Human Resources > Employee > General tab > User Id). Otherwise the E-mail option on the Batch tab will not be enabled. The status and jobdetails of the batch job are sent in the e-mail body (exactly as you requested) If you do not want the e-mail to be sent for successful jobs, but only for failed one’s i suggest to have a look in \Classes\BatchRun\runJob (the sendmail method is started at the end of this method) and \Classes\BatchRun\sendMail You could add some statements here to get the behavior you require. Regards Willy

ok, thanks for the pointer. now i have to limit the email so that if it comes through on the batch group ‘barcode’ it only sends on error. To be honest im not much of a coder, i can look at it and understand why its doing something, ive just never made the step onto coding myself!