Epicor 9.05.702A Progress - Advice on BPM Application

Miguel - thank you so much for sharing this. It is a huge help I really appreciate it.

Sarah

Hi,

I am hoping to get some general advice from more experienced BPM users... We have an issue at our company with the receiving process, and communication of "important" receipts. I have been asked to use the system to create email notification on receipts when certain conditions are true.Â

I attended Insights and they did some neat things with BPM's on 10.1. That was my first exposure to BPM's (I had only used BAM's in the past with .p code to send detailed emails).  I cannot do what they are requesting with a BAM because I need to be able to read data from several different tables to determine which receipts need the notification and also who would get notified; and I don't think that can be done with a BAM.

A couple of the examples they are requesting:Â

1) Upon receipt entry in Epicor, if the items being received are flagged as "hot" on the PO line item, then send an email to the contact from the PO Header

2) Upon receipt entry in Epicor, if the item being received is a job subcontract item and the Subcontract operation is HR or MB, and the job planner is not Muldoon -> send an email to the contact from the job header character01 field.

There are several additional scenarios that would need to read data from POLine, POHead, JobOper, JobHead for the conditions & link back to EmpBasic to get the correct email address. There are also many cases (the majority) when the receipt wouldn't warrant any notification at all.

I am just looking for some advice from more experienced BPM users if what they are asking me to do can even be done and more importantly can reasonably be done by a novice?Â

Thanks in advance for any advice... I probably need a real BPM class right about now ... :)

Sarah

Sarah,

 

BPMs allow you to create custom code which will allow you to access tables/data not immediately available from your chosen trigger point (BO).  From there you can move data into the BPMCallContext Fields and use as you need.  If you need code examples or a template of something specific in code, there are lots available on the list.  

 

Brenda

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, June 05, 2015 1:50 PM
To: Vantage List
Subject: [Vantage] Epicor 9.05.702A Progress - Advice on BPM Application

 

 

Hi,

I am hoping to get some general advice from more experienced BPM users... We have an issue at our company with the receiving process, and communication of "important" receipts.  I have been asked to use the system to create email notification on receipts when certain conditions are true. 

I attended Insights and they did some neat things with BPM's on 10.1.  That was my first exposure to BPM's (I had only used BAM's in the past with .p code to send detailed emails).   I cannot do what they are requesting with a BAM because I need to be able to read data from several different tables to determine which receipts need the notification and also who would get notified; and I don't think that can be done with a BAM.

A couple of the examples they are requesting: 

1) Upon receipt entry in Epicor, if the items being received are flagged as "hot" on the PO line item, then send an email to the contact from the PO Header

2) Upon receipt entry in Epicor, if the item being received is a job subcontract item and the Subcontract operation is HR or MB, and the job planner is not Muldoon -> send an email to the contact from the job header character01 field.

There are several additional scenarios that would need to read data from POLine, POHead, JobOper, JobHead for the conditions & link back to EmpBasic to get the correct email address.  There are also many cases (the majority) when the receipt wouldn't warrant any notification at all.

I am just looking for some advice from more experienced BPM users if what they are asking me to do can even be done and more importantly can reasonably be done by a novice? 

Thanks in advance for any advice... I probably need a real BPM class right about now ... :)

Sarah

Just for clarification, all that can be done in a BAM (utilize the alert program functionality which invokes a .p program) That program will need a touch more code than the BPM might but its not too far of a stretch. That being said I’d still go the BPM route as they don’t seem to be developing BAM’s much as a functionality any longer and have been replaced with other tools since 9. There are several approaches you could take with the BPM to get this done, some require less coding but more steps like a simple preprocess condition with an action that queries the data you want included in the email stored in the callcontextbpmdata and that would allow you to use the standard BPM email boilerplate and grab it from there in a subsequent action. The other route you could do it all by code executing a 4GL action (example below – not my code, just something I had snagged off the group years ago..) This shows how to set your variables, query records and do stuff..

/*Create variable to hold stuff, i.e. old value and new value*/
DEF VAR msg AS CHARACTER NO-UNDO.
DEF VAR origPartNum AS CHARACTER NO-UNDO.
DEF VAR newPartNum AS CHARACTER NO-UNDO.
DEF VAR custName AS CHARACTER NO-UNDO.
DEF VAR quoteNum AS CHARACTER NO-UNDO.
DEF VAR quoteLine AS CHARACTER NO-UNDO.

/*Get original record with blank RowMod*/
FOR EACH ttQuoteDtl WHERE ttQuoteDtl.Company=CUR-COMP AND ttQuoteDtl.RowMod='' no-lock:
origPartNum = ttQuoteDtl.PartNum.
quoteNum = STRING(ttQuoteDtl.QuoteNum).
quoteLine = STRING(ttQuoteDtl.QuoteLine).

/*next lines used for debugging*/
/*msg = "RowMod:" + STRING(ttQuoteDtl.RowMod).
{lib/PublishInfoMsg.i &InfoMsg = msg }.
msg = "origPartNum:" + STRING(origPartNum).
{lib/PublishInfoMsg.i &InfoMsg = msg }.*/
END.

/*now find changes*/
FOR EACH ttQuoteDtl WHERE ttQuoteDtl.Company=CUR-COMP AND ttQuoteDtl.RowMod='U' no-lock:
FIND FIRST Customer WHERE Customer.Company=CUR-COMP AND Customer.CustNum=ttQuoteDtl.CustNum.

/*if nothing changed the next code block is skipped*/
IF AVAIL Customer THEN
DO:
newPartNum = ttQuoteDtl.PartNum.
custName = Customer.Name.
/*msg = "RowMod:" + STRING(ttQuoteDtl.RowMod).
{lib/PublishInfoMsg.i &InfoMsg = msg }.
msg = "newPartNum:" + STRING(newPartNum).
{lib/PublishInfoMsg.i &InfoMsg = msg }.*/

/*This next IF is important. Maybe someone activated the field and hit a key which might trigger an Update event, but if the values are the same then don't send a notification*/
IF STRING(origPartNum) NE STRING(newPartNum) THEN
DO:
repeat:
/*create some email related variables*/
define variable vFrom as character no-undo initial '':U.
define variable vTo as character no-undo initial '':U.
define variable vCC as character no-undo initial '':U.
define variable vSubject as character no-undo initial '':U.
define variable vBody as character no-undo initial '':U.
define variable hEmailEx as handle no-undo.

run Bpm/BpmEmail.p persistent set hEmailEx.
/*I honestly can't remember why these integer cnt variables are in here.*/
define variable from_cnt as integer no-undo.
assign vFrom = 'sender@...<mailto:%27sender%40domain.com>'.

define variable to_cnt as integer no-undo.
assign vTo = 'recipient@...<mailto:%27recipient%40domain.com>'.

define variable cc_cnt as integer no-undo.
assign vCC = ''.

define variable subject_cnt as integer no-undo.
assign vSubject = 'Notification: Part Number Change'.

define variable body_cnt as integer no-undo.
assign vBody = "A part number has been modified." + CHR(10) + CHR(10)
+ "Customer: " + custName + CHR(10)
+ "Quote Number: " + quoteNum + " Line: " + quoteLine + CHR(10)
+ "Original PartNum: " + origPartNum + CHR(10)
+ "New PartNum: " + newPartNum.

run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
"":U
).
/*optional variables that can be included in the SendEmail call*/
/* async as logical
company as character
emailFrom as character
emailTo as character
emailCC as character
emailSubject as character
emailText as character
emailMimeHeader as character */

IF valid-handle(hEmailEx) THEN delete procedure hEmailEx.
leave.
END.
END.
END.
END.

The other way, you would just construct your queries to grab the data you wanted to convey in your email and store it and use a field map in the BPM email designer, this would preclude the need to manage the code for sending and constructing the email format etc needed in the first example.

A query that stores data in the callcontext fields would look as such.. sequenced correctly in the actions section that data can then be grabbed in your email template.

/* Find Release & add Born on Date */
For each ttOrderDtl where ttOrderDtl.RowMod = 'A' no-lock.
Find Last OrderDtl where OrderDtl.Company = Cur-Comp and OrderDtl.OrderNum = ttOrderDtl.OrderNum no-Lock.
If avail OrderDtl Then DO:
Assign ttCallContextBpmData.Number01 = OrderDtl.OrderNum.
Assign ttCallContextBpmData.Number02 = OrderDtl.OrderLine + 1.
Assign ttCallContextBpmData.Number03 = 1.
end.
Else Do:
Assign ttCallContextBpmData.Number01 = OrderDtl.OrderNum.
Assign ttCallContextBpmData.Number02 = 1.
Assign ttCallContextBpmData.Number03 = 1.
End.
End.


Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-3119
FAX: (715)284-4084
[cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, June 05, 2015 12:50 PM
To: Vantage List
Subject: [Vantage] Epicor 9.05.702A Progress - Advice on BPM Application



Hi,

I am hoping to get some general advice from more experienced BPM users... We have an issue at our company with the receiving process, and communication of "important" receipts. I have been asked to use the system to create email notification on receipts when certain conditions are true.

I attended Insights and they did some neat things with BPM's on 10.1. That was my first exposure to BPM's (I had only used BAM's in the past with .p code to send detailed emails). I cannot do what they are requesting with a BAM because I need to be able to read data from several different tables to determine which receipts need the notification and also who would get notified; and I don't think that can be done with a BAM.

A couple of the examples they are requesting:

1) Upon receipt entry in Epicor, if the items being received are flagged as "hot" on the PO line item, then send an email to the contact from the PO Header

2) Upon receipt entry in Epicor, if the item being received is a job subcontract item and the Subcontract operation is HR or MB, and the job planner is not Muldoon -> send an email to the contact from the job header character01 field.

There are several additional scenarios that would need to read data from POLine, POHead, JobOper, JobHead for the conditions & link back to EmpBasic to get the correct email address. There are also many cases (the majority) when the receipt wouldn't warrant any notification at all.

I am just looking for some advice from more experienced BPM users if what they are asking me to do can even be done and more importantly can reasonably be done by a novice?

Thanks in advance for any advice... I probably need a real BPM class right about now ... :)

Sarah



[Non-text portions of this message have been removed]

Thank you so much Rob and Brenda. Knowing it is possible is a good starting point. Really appreciate the feedback and the code examples!


We have a “Hot Shortage” checkbox on the PO Line

 

 

define variable body     as character no-undo.

define variable vFrom    as character no-undo.

define variable vTo      as character no-undo.

define variable vCC      as character no-undo.

define variable vSubject as character no-undo.

define variable vBody    as character no-undo.

 

define variable hEmailEx  as handle no-undo.

run Bpm/BpmEmail.p persistent set hEmailEx.

 

vFrom = "Epicor9@...".

vTo = "ProdCntl@...".

 

assign body = "This part was a HOT Shortage - Informational Only.~rClick OK to Continue" .

 

for each ttrcvdtl where (ttrcvdtl.RowMod = 'U' or ttrcvdtl.RowMod = 'A') and ttrcvdtl.Received = yes, each porel where (porel.Company = ttrcvdtl.Company and porel.PONum = ttrcvdtl.PONum and porel.POLine = ttrcvdtl.POLine and porel.PORelNum = ttrcvdtl.PORelNum and porel.CheckBox01 = yes) no-lock:

 

 

vSubject =  "Hot Shortage Part Num: " + ttrcvdtl.PartNum.

vBody = "Hot shortage part " + ttrcvdtl.PartNum + " has just been received.~rPO Number: " + string(ttrcvdtl.PONum) + "~rLine: " + string(ttrcvDtl.POLine) +  "~rRelease: " + string(ttRcvDtl.PORelNum) + "~rReceiving Qty: " + string(ttRcvDtl.ReceivedQty) + "~rPO Due Date: " + string(ttRcvDtl.DueDate) + "~r~rBPM.Receipt.Update.PrePro.20".

   run SendEmail in hEmailEx (false,ttrcvdtl.company,vFrom,vTo,vCC,vSubject,vBody,"").

{lib\PublishInfoMsg.i &InfoMsg = body}

end.

 

/*assign body = "This part was a HOT Shortage - Informational Only.~rClick OK to Continue" . */

 

/*{lib\PublishInfoMsg.i &InfoMsg = body}*/

 

Miguel A. Santillan

Compass Manufacturing Systems

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, June 5, 2015 11:59 AM
To: Vantage List
Subject: Re: [Vantage] Epicor 9.05.702A Progress - Advice on BPM Application

 

 

Thank you so much Rob and Brenda.  Knowing it is possible is a good starting point.  Really appreciate the feedback and the code examples!

Sorry Reciept.Update

 

No condition

 

 

Miguel A. Santillan

Compass Manufacturing Systems

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, June 5, 2015 2:51 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Epicor 9.05.702A Progress - Advice on BPM Application

 

 

We have a “Hot Shortage” checkbox on the PO Line

 

 

define variable body     as character no-undo.

define variable vFrom    as character no-undo.

define variable vTo      as character no-undo.

define variable vCC      as character no-undo.

define variable vSubject as character no-undo.

define variable vBody    as character no-undo.

 

define variable hEmailEx  as handle no-undo.

run Bpm/BpmEmail.p persistent set hEmailEx.

 

vFrom = "Epicor9@...".

vTo = "ProdCntl@...".

 

assign body = "This part was a HOT Shortage - Informational Only.~rClick OK to Continue" .

 

for each ttrcvdtl where (ttrcvdtl.RowMod = 'U' or ttrcvdtl.RowMod = 'A') and ttrcvdtl.Received = yes, each porel where (porel.Company = ttrcvdtl.Company and porel.PONum = ttrcvdtl.PONum and porel.POLine = ttrcvdtl.POLine and porel.PORelNum = ttrcvdtl.PORelNum and porel.CheckBox01 = yes) no-lock:

 

 

vSubject =  "Hot Shortage Part Num: " + ttrcvdtl.PartNum.

vBody = "Hot shortage part " + ttrcvdtl.PartNum + " has just been received.~rPO Number: " + string(ttrcvdtl.PONum) + "~rLine: " + string(ttrcvDtl.POLine) +  "~rRelease: " + string(ttRcvDtl.PORelNum) + "~rReceiving Qty: " + string(ttRcvDtl.ReceivedQty) + "~rPO Due Date: " + string(ttRcvDtl.DueDate) + "~r~rBPM.Receipt.Update.PrePro.20".

   run SendEmail in hEmailEx (false,ttrcvdtl.company,vFrom,vTo,vCC,vSubject,vBody,"").

{lib\PublishInfoMsg.i &InfoMsg = body}

end.

 

/*assign body = "This part was a HOT Shortage - Informational Only.~rClick OK to Continue" . */

 

/*{lib\PublishInfoMsg.i &InfoMsg = body}*/

 

Miguel A. Santillan

Compass Manufacturing Systems

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Friday, June 5, 2015 11:59 AM
To: Vantage List
Subject: Re: [Vantage] Epicor 9.05.702A Progress - Advice on BPM Application

 

 

Thank you so much Rob and Brenda.  Knowing it is possible is a good starting point.  Really appreciate the feedback and the code examples!