5 Replies Latest reply on Oct 31, 2012 12:48 PM by KellyDGreen

    Batch Loader Email

      I am using a process method of serial and I have an email notification code in the batch loader script that is sent out to the admin. The email notifcation has a message based on the Process State. If I am testing with one file, the email sent with no issues. If am testing multiple files, the email is sent out when the last file is loaded. I would like an email sent out to the admin after every file is loaded.

      Any suggestions are appreciated.
        • 1. Re: Batch Loader Email
          Where is your script code that writes the current e-mail at present. In the Batch Action Script, there are two events, at the end, called AftProcessFile and aftProcessBatch. Have you tried putting the code in the aftProcessFile event? you may need to access the batch loader file collection to get the process state for the selected file.
          • 2. Re: Batch Loader Email
            I went through the process of setting the paramaters for batch processing, then created the script. I placed the email in that script. I did not use the BatchAction.
            • 3. Re: Batch Loader Email
              Yes, I follow you and that's a problem with writing the e-mail notification from within the Batch Loader script that you created.

              If you wan to do this in the Batch Loader script that you've made, then you would need to call the BATCHENG for the current BatchID and then call the recordset to list the files collected during the BATCHENG process. Then once you have the list of files, you can do a loop to trigger nofication for each file. I won't be able give you source code for this, but if you go through the Supplemental API in the workbench, it has everything you need.

              For example, calling "farsFileListforBatchID" will return a list of all files for the specified BatchID. This works for SERIAL running batches, but there are some issues when running in Parallel.
              1 person found this helpful
              • 4. Re: Batch Loader Email
                have a look at the following recent post for an example of what the previous post has explained.

                Batch Script Processing - Please Help

                I have not tried this, but the only issue may be as to when the collection of files in a batch gets deleted (If it does as part fo the batch process)
                1 person found this helpful
                • 5. Re: Batch Loader Email
                  Move the email code to the Action scripts instead of the batch. If you put the email in AftLoad, for example, it will send after each file loads.
                  1 person found this helpful