BPM to send email to dispatcher in Purchase Req


(Adam Smith) #1

I am trying to find a way to send an email to the next dispatcher of a Purchase Req. Since the ReqHead table does not have an email address field, I would assume that you would need to do a search within the UserFile table and compare it the the ReqHead.NextDispatcherID. Unfortunately, I do not know how to exactly do this. Does anyone do this? How exactly do you do it?

Thanks,
Adam Smith


(Calvin Krusen) #2

Here’s part of an email notice that we had in V8. It retrieved an email address from UD table UD05. You should substitute:

  • UserFile for UD05
  • DcdUserID for ShortChar01
  • ReqHead.NextDispatcherID for pm (in the Where clause)
  • your variable that holds the email address for pmEmail
  • EMailAddress for ShortChar02
DEFINE VARIABLE pmEmail AS CHARACTER NO-UNDO.

FIND FIRST UD05 WHERE (Ud05.Company = 'MC') AND (UD05.ShortChar01 = pm) NO-LOCK NO-ERROR.
IF AVAILABLE UD05 THEN DO:
  pmEmail = UD05.ShortChar02.
END.

If you need other values from the User File, retriev them in that IF AVAILABLE ... END block


(Calvin Krusen) #3

Did you just need help with getting the email from the userfile? Or do you need help for the whole thing?


(Adam Smith) #4

Actually the whole thing. I currently created a PreProcess on the Req.Update method.
My condition is setup as:
the ttReqHead.NextDispatcherID field has been changed from any to “michael.billings”

The Action is setup as - synchronously execute 4GL code:
FIND UserFile WHERE (UserFile.DcdUserID = ttReqHead.NextDispatcherID) NO-LOCK NO-ERROR.
ttReqHead.ShortChar01 = UserFile.EMailAddress.

The condition does trigger the process, but I get an error saying: "ERROR condition: The Server application has returned an error. (7243) (7211) "

In my testing, it looks like the error is triggered whenever I try to assign a field to something.


(Calvin Krusen) #5

Been a few years since I did this in V8. I don’t recall the exact terminology in V8 so I’ll describe them as I remember:

  1. We used the system that can log / send an email / or run a program upon change of a DB field. (What are called Data Directives in E10)
  2. This monitored the ShipHead table for a change of the shipping status flag, to “SHIPPED”
  3. We had it execute a program that I wrote.
    a. a text file named “ShipmentAlert.p”
    b. that file resided in “E:Epicor\mfgsys803\Server\ud\Alerts” on the server
  4. The ShipmentAlert.p program would receive use ShipHead as the inputs, build the email, and then send it.

Before any of that would work, is your V8 currently capable of sending emails?

I can sen you the ShipmentAlert.p file for you to look at. It’s moderately documented. But if you’ve not programmed in 4GL/ABL (not sure exactly what Progress calls it), it might not make sense.

.


(Adam Smith) #6

Calvin.

Yes, my system is capable of sending emails. I can hard code my email address in and I get the email. However, I do not want the emails to come to only me. I want the email to go to the person that needs to dispatch the requisition, which that person could be anybody, hence the need to lookup their email address from the UserFile table. If you could send me that program, I can see what I can do to decipher it.

Much appreciated.


(Calvin Krusen) #7

One thing I recall. We used a BAM (Business Activity Monitor) - what E10 now calls a Data Directive.

I’ll try to pull together the info this weekend.