BPM help needed - PO approval

You can do this via Pre-Processing and Post Processing BPM Method Directives on PO.Update to send an email to the approver and cc the buyer..

For the pre:
Set the condition as "The  ttPOHeader.ApprovalStatusfield has been changed from any to P"
Set the action as "Enable post processing directive"

For the post:
Set the condition as "this directive has been enabled by the specified directive" and select your BPM
Set the action as "Custom ABL" and paste the following

/* POForApprovalEmail */                

 

define variable vapprov as character no-undo.

define variable vbuyer as character no-undo.

 

for each ttPOHeader where ttPOHeader.ApprovalStatus = 'P'.

if avail ttPOHeader then do:

Find first PurAgent where PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = ttPOHeader.BuyerID.

assign vapprov = PurAgent.ApprovalPerson.

Find first PurAgent where PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = vapprov.

assign vapprov = PurAgent.EMailAddress.

 

Find first PurAgent where PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = ttPOHeader.BuyerID.

assign vbuyer = PurAgent.EmailAddress.

 

if vapprov <> '' then do:

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.

 

assign vFrom = vbuyer.

assign vTo = vapprov.

assign vCC = ''.

assign vSubject = vSubject + 'Purchase Order ' + string(ttPOHeader.PONUM) + ' needs approval'.

assign vBody = vBody + 'The above purchase order number requires approval'.

 

run SendEmail in hEmailEx (false,CUR-COMP,vFrom,vTo,vCC,vSubject,vBody,"").

if valid-handle(hEmailEx) then delete procedure hEmailEx.

leave.

end.

end.

end.


 

Hi all,

 

I’m needing help on setting up a BPM to alert a particular buyer when they need to approve a PO.  For example buyer A has a limit of $100, B has $200, C has $300.  If buyer A tries to approve a PO that is over $100, I want the system to automatically send an email notifying buyer B that they have a PO to approve and so on and so forth for all buyers and their dollar limits.  Easiest way????

 

Mike Abell

Information Technology Manager
Flexial - BOA Group - Cookeville, Tennessee
Office:   931.432.8408
Mobile:  615.418.3055
 
email:  MAbell@...

 

There are built in Global Alerts for this I think look into them.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Fri, Feb 6, 2015 at 3:32 PM, Mike Abell mabell@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>

Hi all,

Â

I’m needing help on setting up a BPM to alert a particular buyer when they need to approve a PO. For example buyer A has a limit of $100, B has $200, C has $300. If buyer A tries to approve a PO that is over $100, I want the system to automatically send an email notifying buyer B that they have a PO to approve and so on and so forth for all buyers and their dollar limits. Easiest way????

Â

Mike Abell

Information Technology Manager
Flexial - BOA Group - Cookeville, Tennessee
Office:Â Â Â 931.432.8408
Mobile:Â 615.418.3055
Â
email:Â MAbell@...

Â

</div>
 


<div style="color:#fff;min-height:0;"></div>