Sending an e-mail from a BPM

See Nathan's post


-----Original Message-----
From: Nathan [mailto:bonner.n@...]
Sent: December 10, 2009 11:42 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: PO Approval Emails




Sounds like you're already well on your way with a solid solution but if you
find it is more limited than you'd like in terms of only sending email to
specific recipients (only the PO creator and approver, etc.) you might find
the following interesting:

We use this to notify the appropriate PO Approver when a buyer has created a
PO that is over their limit.

BO.Method: PO.Update
PreProcess Condition: the ttPOHeader.ApprovalStatus field has been changed
from any to 'P'

PreProcess Action: enable dependent post process directives

PostProcess Condition: this directive has been enabled from the
PendingApprovalEmail directive

PostProcess Action: (4GL Code)

for each ttPOHeader no-lock.

Define variable vPurAuth as character no-undo.
Define variable vAuthID as character no-undo.

Assign vPurAuth = ''.
Assign vAuthID = ''.

Repeat:
Find next PurAgent where (PurAgent.Company = ttPOHeader.Company and
PurAgent.BuyerID = ttPOHeader.BuyerID) no-lock.

If available PurAgent then do:

Assign vAuthID = PurAgent.ApprovalPerson.

Repeat:
Find Next PurAuth where (PurAgent.Company = PurAuth.Company and
PurAgent.ApprovalPerson = PurAuth.BuyerID) no-lock .

If available PurAuth then do:

Assign vPurAuth = vPurAuth + PurAuth.DcdUserID + "@...; ".

End.

If not available PurAuth then return.

End.

End.

If not available PurAgent then return.

End.

Define variable vAuthName as character no-undo.

Assign vAuthName = ''.

For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.

Assign vAuthName = PurAgent.Name.

Leave.

End.

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

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 = 'vantage@totalplast <mailto:%27vantage%40totalplastics.com>
ics.com'.
assign vTo = vPurAuth.
assign vCC = vCC + string( ttPOHeader.EntryPerson + '@totalplastics.
<mailto:%27%40totalplastics.com> com').
assign vSubject = vSubject + 'PO Num, ' + String(ttPOHeader.PONum) + ' is
pending ' + vAuthName + '''s approval'.
assign vBody = vBody + 'Please review PO Num, ' + String(ttPOHeader.PONum) +
' for ' + ttPOHeader.EntryPerson .

run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
String( ttPOHeader.ApprovalStatus )
).
if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.

Once the PO has been approved we wanted an email sent back to the buyer to
let them know so...

BO.Method: POApvMsg.Update

PreProcess Conditions: the ttPOApvMsg.ApproverResponse field has been
changed from any to any
or the ttPOApvMsg.ApproverResponse field has been changed from ? to any
or the ttPOApvMsg.ApproverResponse field has been changed from '' to any
(This is likely overkill but it gets the job done and I haven't taken time
to go back and clean it up)

PreProcess Actions: enable dependent post process directives

PostProcess Conditions: this directive has been enabled from the
POApprovalEmail directive

PostProcess Actions: (4GL Code)

for each ttPOApvMsg where ttPOApvMsg.ApproverResponse <> '' no-lock, each
POHeader where POHeader.Company = ttPOApvMsg.Company and POHeader.PONum =
ttPOApvMsg.PONum no-lock.

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 = 'vantage@totalplast <mailto:%27vantage%40totalplastics.com>
ics.com'.
assign vTo = POHeader.EntryPerson + '@totalplastics.
<mailto:%27%40totalplastics.com> com'.
assign vCC = vCC + ttPOApvMsg.DcdUserID + '@totalplastics.
<mailto:%27%40totalplastics.com> com'.
assign vSubject = vSubject + 'Your PO Num, ' + String(ttPOApvMsg.PONum) + '
has been ' + ttPOApvMsg.ApproverResponse.
assign vBody = vBody + ttPOApvMsg.MsgText.

run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
ttPOApvMsg.MsgText
).
if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.

Hope this stirs the creative juices...

NB

--- In vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com, "Gerry
Loranger" <gloranger@...> wrote:
>
> Hi Lissette. It is Pre.
>
>
>
> Gerry
>
>
>
>
>
> From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com] On
Behalf Of
> liss_c
> Sent: Wednesday, December 09, 2009 5:57 PM
> To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
> Subject: [Vantage] Re: PO Approval Emails
>
>
>
>
>
> HI Gerry,
>
> Is your method directive pre. post or base processing. I am testing out
this
> cause i need to sen email alerts for PO approvals and Requisitions
> Dispatching.
>
> thanks,
>
> Lissette C.
>
> --- In vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com> , "Gerry
> Loranger" <gloranger@> wrote:
> >
> > Hello, I use a Method Directive on PO.Update.
> >
> >
> >
> > The condition is: the POHeader.Approve field of the changed row is equal
> to
> > the True value
> >
> >
> >
> > and the Actions is: send e-mail synchronously based on the
EmailPOApprover
> > template
> >
> >
> >
> > The email template is as follows:
> >
> >
> >
> > PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> > <EntryPerson/>.
> >
> >
> >
> > This PO totals $<POTotal/> (<MyCurrencyCode/>)
> >
> >
> >
> >
> >
> > Gerry
> >
> >
> >
> >
> >
> >
> >
> > From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com> ] On
> Behalf Of
> > idiabos
> > Sent: Wednesday, December 09, 2009 10:51 AM
> > To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
<mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] PO Approval Emails
> >
> >
> >
> >
> >
> > Hello,
> >
> > I was wonder if Vantage was setup to automatically send emails for PO
> > Approvals based on the Buyer Setup table. Or will I need to create a BPM
> to
> > handle this? Thanks in advance!!
> >
> > -Sal
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>







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

I was wonder if Vantage was setup to automatically send emails for PO Approvals based on the Buyer Setup table. Or will I need to create a BPM to handle this? Thanks in advance!!

-Sal
Hello, I use a Method Directive on PO.Update.



The condition is: the POHeader.Approve field of the changed row is equal to
the True value



and the Actions is: send e-mail synchronously based on the EmailPOApprover
template



The email template is as follows:



PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
<EntryPerson/>.



This PO totals $<POTotal/> (<MyCurrencyCode/>)





Gerry







From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
idiabos
Sent: Wednesday, December 09, 2009 10:51 AM
To: vantage@yahoogroups.com
Subject: [Vantage] PO Approval Emails





Hello,

I was wonder if Vantage was setup to automatically send emails for PO
Approvals based on the Buyer Setup table. Or will I need to create a BPM to
handle this? Thanks in advance!!

-Sal





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

Is your method directive pre. post or base processing. I am testing out this cause i need to sen email alerts for PO approvals and Requisitions Dispatching.

thanks,

Lissette C.

--- In vantage@yahoogroups.com, "Gerry Loranger" <gloranger@...> wrote:
>
> Hello, I use a Method Directive on PO.Update.
>
>
>
> The condition is: the POHeader.Approve field of the changed row is equal to
> the True value
>
>
>
> and the Actions is: send e-mail synchronously based on the EmailPOApprover
> template
>
>
>
> The email template is as follows:
>
>
>
> PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> <EntryPerson/>.
>
>
>
> This PO totals $<POTotal/> (<MyCurrencyCode/>)
>
>
>
>
>
> Gerry
>
>
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> idiabos
> Sent: Wednesday, December 09, 2009 10:51 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] PO Approval Emails
>
>
>
>
>
> Hello,
>
> I was wonder if Vantage was setup to automatically send emails for PO
> Approvals based on the Buyer Setup table. Or will I need to create a BPM to
> handle this? Thanks in advance!!
>
> -Sal
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Hi Lissette. It is Pre.



Gerry





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
liss_c
Sent: Wednesday, December 09, 2009 5:57 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: PO Approval Emails





HI Gerry,

Is your method directive pre. post or base processing. I am testing out this
cause i need to sen email alerts for PO approvals and Requisitions
Dispatching.

thanks,

Lissette C.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Gerry
Loranger" <gloranger@...> wrote:
>
> Hello, I use a Method Directive on PO.Update.
>
>
>
> The condition is: the POHeader.Approve field of the changed row is equal
to
> the True value
>
>
>
> and the Actions is: send e-mail synchronously based on the EmailPOApprover
> template
>
>
>
> The email template is as follows:
>
>
>
> PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> <EntryPerson/>.
>
>
>
> This PO totals $<POTotal/> (<MyCurrencyCode/>)
>
>
>
>
>
> Gerry
>
>
>
>
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
> idiabos
> Sent: Wednesday, December 09, 2009 10:51 AM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] PO Approval Emails
>
>
>
>
>
> Hello,
>
> I was wonder if Vantage was setup to automatically send emails for PO
> Approvals based on the Buyer Setup table. Or will I need to create a BPM
to
> handle this? Thanks in advance!!
>
> -Sal
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]
Sounds like you're already well on your way with a solid solution but if you find it is more limited than you'd like in terms of only sending email to specific recipients (only the PO creator and approver, etc.) you might find the following interesting:

We use this to notify the appropriate PO Approver when a buyer has created a PO that is over their limit.

BO.Method: PO.Update
PreProcess Condition: the ttPOHeader.ApprovalStatus field has been changed from any to 'P'

PreProcess Action: enable dependent post process directives

PostProcess Condition: this directive has been enabled from the PendingApprovalEmail directive

PostProcess Action: (4GL Code)

for each ttPOHeader no-lock.

Define variable vPurAuth as character no-undo.
Define variable vAuthID as character no-undo.

Assign vPurAuth = ''.
Assign vAuthID = ''.

Repeat:
Find next PurAgent where (PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = ttPOHeader.BuyerID) no-lock.

If available PurAgent then do:

Assign vAuthID = PurAgent.ApprovalPerson.

Repeat:
Find Next PurAuth where (PurAgent.Company = PurAuth.Company and PurAgent.ApprovalPerson = PurAuth.BuyerID) no-lock .

If available PurAuth then do:

Assign vPurAuth = vPurAuth + PurAuth.DcdUserID + "@...; ".

End.

If not available PurAuth then return.

End.

End.

If not available PurAgent then return.

End.


Define variable vAuthName as character no-undo.

Assign vAuthName = ''.

For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.

Assign vAuthName = PurAgent.Name.

Leave.

End.


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


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 = 'vantage@...'.
assign vTo = vPurAuth.
assign vCC = vCC + string( ttPOHeader.EntryPerson + '@...').
assign vSubject = vSubject + 'PO Num, ' + String(ttPOHeader.PONum) + ' is pending ' + vAuthName + '''s approval'.
assign vBody = vBody + 'Please review PO Num, ' + String(ttPOHeader.PONum) + ' for ' + ttPOHeader.EntryPerson .

run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
String( ttPOHeader.ApprovalStatus )
).
if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.

Once the PO has been approved we wanted an email sent back to the buyer to let them know so...

BO.Method: POApvMsg.Update

PreProcess Conditions: the ttPOApvMsg.ApproverResponse field has been changed from any to any
or the ttPOApvMsg.ApproverResponse field has been changed from ? to any
or the ttPOApvMsg.ApproverResponse field has been changed from '' to any (This is likely overkill but it gets the job done and I haven't taken time to go back and clean it up)

PreProcess Actions: enable dependent post process directives

PostProcess Conditions: this directive has been enabled from the POApprovalEmail directive

PostProcess Actions: (4GL Code)

for each ttPOApvMsg where ttPOApvMsg.ApproverResponse <> '' no-lock, each POHeader where POHeader.Company = ttPOApvMsg.Company and POHeader.PONum = ttPOApvMsg.PONum no-lock.

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 = 'vantage@...'.
assign vTo = POHeader.EntryPerson + '@...'.
assign vCC = vCC + ttPOApvMsg.DcdUserID + '@...'.
assign vSubject = vSubject + 'Your PO Num, ' + String(ttPOApvMsg.PONum) + ' has been ' + ttPOApvMsg.ApproverResponse.
assign vBody = vBody + ttPOApvMsg.MsgText.

run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
ttPOApvMsg.MsgText
).
if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.

Hope this stirs the creative juices...

NB



--- In vantage@yahoogroups.com, "Gerry Loranger" <gloranger@...> wrote:
>
> Hi Lissette. It is Pre.
>
>
>
> Gerry
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> liss_c
> Sent: Wednesday, December 09, 2009 5:57 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: PO Approval Emails
>
>
>
>
>
> HI Gerry,
>
> Is your method directive pre. post or base processing. I am testing out this
> cause i need to sen email alerts for PO approvals and Requisitions
> Dispatching.
>
> thanks,
>
> Lissette C.
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Gerry
> Loranger" <gloranger@> wrote:
> >
> > Hello, I use a Method Directive on PO.Update.
> >
> >
> >
> > The condition is: the POHeader.Approve field of the changed row is equal
> to
> > the True value
> >
> >
> >
> > and the Actions is: send e-mail synchronously based on the EmailPOApprover
> > template
> >
> >
> >
> > The email template is as follows:
> >
> >
> >
> > PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> > <EntryPerson/>.
> >
> >
> >
> > This PO totals $<POTotal/> (<MyCurrencyCode/>)
> >
> >
> >
> >
> >
> > Gerry
> >
> >
> >
> >
> >
> >
> >
> > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> Behalf Of
> > idiabos
> > Sent: Wednesday, December 09, 2009 10:51 AM
> > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] PO Approval Emails
> >
> >
> >
> >
> >
> > Hello,
> >
> > I was wonder if Vantage was setup to automatically send emails for PO
> > Approvals based on the Buyer Setup table. Or will I need to create a BPM
> to
> > handle this? Thanks in advance!!
> >
> > -Sal
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Vantage 8.03.408A

Nathan,

This is great. I currently have a BPM firing an email when exceeding the limit. However, I hardcoded the email addresses. Wouldn't mind changing that to your format. I was never able to get an email to fire back once approved. Would love to use your information. However, I am receiving an error and not sure what I am missing.

This is the error on the email to the approver.

Error Detail
============
** Unable to understand after -- ".For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.Assign vAuthName = PurAgent.Name.Leave.End./*/*------------------------------------------------------------------------ File : lib/PublishInfoMsg.i Purpose : Adds informational message Arguments : &InfoMsg = Text Message to publish. Syntax : Description : Author(s) : Sergey Fefelov Created : 2006-10-27 Notes : History : 10/27/06 SFefelov SCR40330
** D:\epicor\mfgsys803\Server\lib\PublishInfoMsg.i Could not understand line 26. (198)
** Unknown Field or Variable name - vFrom. (201)
** Could not understand line 73. (196

Any thoughts?

Jeff

--- In vantage@yahoogroups.com, "Nathan" <bonner.n@...> wrote:
>
> Sounds like you're already well on your way with a solid solution but if you find it is more limited than you'd like in terms of only sending email to specific recipients (only the PO creator and approver, etc.) you might find the following interesting:
>
> We use this to notify the appropriate PO Approver when a buyer has created a PO that is over their limit.
>
> BO.Method: PO.Update
> PreProcess Condition: the ttPOHeader.ApprovalStatus field has been changed from any to 'P'
>
> PreProcess Action: enable dependent post process directives
>
> PostProcess Condition: this directive has been enabled from the PendingApprovalEmail directive
>
> PostProcess Action: (4GL Code)
>
> for each ttPOHeader no-lock.
>
> Define variable vPurAuth as character no-undo.
> Define variable vAuthID as character no-undo.
>
> Assign vPurAuth = ''.
> Assign vAuthID = ''.
>
> Repeat:
> Find next PurAgent where (PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = ttPOHeader.BuyerID) no-lock.
>
> If available PurAgent then do:
>
> Assign vAuthID = PurAgent.ApprovalPerson.
>
> Repeat:
> Find Next PurAuth where (PurAgent.Company = PurAuth.Company and PurAgent.ApprovalPerson = PurAuth.BuyerID) no-lock .
>
> If available PurAuth then do:
>
> Assign vPurAuth = vPurAuth + PurAuth.DcdUserID + "@...; ".
>
> End.
>
> If not available PurAuth then return.
>
> End.
>
> End.
>
> If not available PurAgent then return.
>
> End.
>
>
> Define variable vAuthName as character no-undo.
>
> Assign vAuthName = ''.
>
> For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.
>
> Assign vAuthName = PurAgent.Name.
>
> Leave.
>
> End.
>
>
> /*{lib\PublishInfoMsg.i &InfoMsg = "vPurAuth"}.*/
>
>
> 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 = 'vantage@...'.
> assign vTo = vPurAuth.
> assign vCC = vCC + string( ttPOHeader.EntryPerson + '@...').
> assign vSubject = vSubject + 'PO Num, ' + String(ttPOHeader.PONum) + ' is pending ' + vAuthName + '''s approval'.
> assign vBody = vBody + 'Please review PO Num, ' + String(ttPOHeader.PONum) + ' for ' + ttPOHeader.EntryPerson .
>
> run SendEmail in hEmailEx (
> false,
> CUR-COMP,
> vFrom,
> vTo,
> vCC,
> vSubject,
> vBody,
> String( ttPOHeader.ApprovalStatus )
> ).
> if valid-handle(hEmailEx) then delete procedure hEmailEx.
> leave.
> end.
>
> Once the PO has been approved we wanted an email sent back to the buyer to let them know so...
>
> BO.Method: POApvMsg.Update
>
> PreProcess Conditions: the ttPOApvMsg.ApproverResponse field has been changed from any to any
> or the ttPOApvMsg.ApproverResponse field has been changed from ? to any
> or the ttPOApvMsg.ApproverResponse field has been changed from '' to any (This is likely overkill but it gets the job done and I haven't taken time to go back and clean it up)
>
> PreProcess Actions: enable dependent post process directives
>
> PostProcess Conditions: this directive has been enabled from the POApprovalEmail directive
>
> PostProcess Actions: (4GL Code)
>
> for each ttPOApvMsg where ttPOApvMsg.ApproverResponse <> '' no-lock, each POHeader where POHeader.Company = ttPOApvMsg.Company and POHeader.PONum = ttPOApvMsg.PONum no-lock.
>
> 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 = 'vantage@...'.
> assign vTo = POHeader.EntryPerson + '@...'.
> assign vCC = vCC + ttPOApvMsg.DcdUserID + '@...'.
> assign vSubject = vSubject + 'Your PO Num, ' + String(ttPOApvMsg.PONum) + ' has been ' + ttPOApvMsg.ApproverResponse.
> assign vBody = vBody + ttPOApvMsg.MsgText.
>
> run SendEmail in hEmailEx (
> false,
> CUR-COMP,
> vFrom,
> vTo,
> vCC,
> vSubject,
> vBody,
> ttPOApvMsg.MsgText
> ).
> if valid-handle(hEmailEx) then delete procedure hEmailEx.
> leave.
> end.
>
> Hope this stirs the creative juices...
>
> NB
>
>
>
> --- In vantage@yahoogroups.com, "Gerry Loranger" <gloranger@> wrote:
> >
> > Hi Lissette. It is Pre.
> >
> >
> >
> > Gerry
> >
> >
> >
> >
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> > liss_c
> > Sent: Wednesday, December 09, 2009 5:57 PM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Re: PO Approval Emails
> >
> >
> >
> >
> >
> > HI Gerry,
> >
> > Is your method directive pre. post or base processing. I am testing out this
> > cause i need to sen email alerts for PO approvals and Requisitions
> > Dispatching.
> >
> > thanks,
> >
> > Lissette C.
> >
> > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Gerry
> > Loranger" <gloranger@> wrote:
> > >
> > > Hello, I use a Method Directive on PO.Update.
> > >
> > >
> > >
> > > The condition is: the POHeader.Approve field of the changed row is equal
> > to
> > > the True value
> > >
> > >
> > >
> > > and the Actions is: send e-mail synchronously based on the EmailPOApprover
> > > template
> > >
> > >
> > >
> > > The email template is as follows:
> > >
> > >
> > >
> > > PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> > > <EntryPerson/>.
> > >
> > >
> > >
> > > This PO totals $<POTotal/> (<MyCurrencyCode/>)
> > >
> > >
> > >
> > >
> > >
> > > Gerry
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> > Behalf Of
> > > idiabos
> > > Sent: Wednesday, December 09, 2009 10:51 AM
> > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > Subject: [Vantage] PO Approval Emails
> > >
> > >
> > >
> > >
> > >
> > > Hello,
> > >
> > > I was wonder if Vantage was setup to automatically send emails for PO
> > > Approvals based on the Buyer Setup table. Or will I need to create a BPM
> > to
> > > handle this? Thanks in advance!!
> > >
> > > -Sal
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
Jeff,

Based on the error message, it looks like you have a "." leading the line that may belong on the prior line or maybe missed a hard return between two lines (combining the lines when they should be seperate).

Call me if you can't get it figured out and we can WebEx you through it...

269.553.5838

Thanks,

NB

--- In vantage@yahoogroups.com, "jplehr" <jlehr@...> wrote:
>
> Vantage 8.03.408A
>
> Nathan,
>
> This is great. I currently have a BPM firing an email when exceeding the limit. However, I hardcoded the email addresses. Wouldn't mind changing that to your format. I was never able to get an email to fire back once approved. Would love to use your information. However, I am receiving an error and not sure what I am missing.
>
> This is the error on the email to the approver.
>
> Error Detail
> ============
> ** Unable to understand after -- ".For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.Assign vAuthName = PurAgent.Name.Leave.End./*/*------------------------------------------------------------------------ File : lib/PublishInfoMsg.i Purpose : Adds informational message Arguments : &InfoMsg = Text Message to publish. Syntax : Description : Author(s) : Sergey Fefelov Created : 2006-10-27 Notes : History : 10/27/06 SFefelov SCR40330
> ** D:\epicor\mfgsys803\Server\lib\PublishInfoMsg.i Could not understand line 26. (198)
> ** Unknown Field or Variable name - vFrom. (201)
> ** Could not understand line 73. (196
>
> Any thoughts?
>
> Jeff
>
> --- In vantage@yahoogroups.com, "Nathan" <bonner.n@> wrote:
> >
> > Sounds like you're already well on your way with a solid solution but if you find it is more limited than you'd like in terms of only sending email to specific recipients (only the PO creator and approver, etc.) you might find the following interesting:
> >
> > We use this to notify the appropriate PO Approver when a buyer has created a PO that is over their limit.
> >
> > BO.Method: PO.Update
> > PreProcess Condition: the ttPOHeader.ApprovalStatus field has been changed from any to 'P'
> >
> > PreProcess Action: enable dependent post process directives
> >
> > PostProcess Condition: this directive has been enabled from the PendingApprovalEmail directive
> >
> > PostProcess Action: (4GL Code)
> >
> > for each ttPOHeader no-lock.
> >
> > Define variable vPurAuth as character no-undo.
> > Define variable vAuthID as character no-undo.
> >
> > Assign vPurAuth = ''.
> > Assign vAuthID = ''.
> >
> > Repeat:
> > Find next PurAgent where (PurAgent.Company = ttPOHeader.Company and PurAgent.BuyerID = ttPOHeader.BuyerID) no-lock.
> >
> > If available PurAgent then do:
> >
> > Assign vAuthID = PurAgent.ApprovalPerson.
> >
> > Repeat:
> > Find Next PurAuth where (PurAgent.Company = PurAuth.Company and PurAgent.ApprovalPerson = PurAuth.BuyerID) no-lock .
> >
> > If available PurAuth then do:
> >
> > Assign vPurAuth = vPurAuth + PurAuth.DcdUserID + "@...; ".
> >
> > End.
> >
> > If not available PurAuth then return.
> >
> > End.
> >
> > End.
> >
> > If not available PurAgent then return.
> >
> > End.
> >
> >
> > Define variable vAuthName as character no-undo.
> >
> > Assign vAuthName = ''.
> >
> > For each PurAgent where PurAgent.BuyerID = vAuthID no-lock.
> >
> > Assign vAuthName = PurAgent.Name.
> >
> > Leave.
> >
> > End.
> >
> >
> > /*{lib\PublishInfoMsg.i &InfoMsg = "vPurAuth"}.*/
> >
> >
> > 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 = 'vantage@'.
> > assign vTo = vPurAuth.
> > assign vCC = vCC + string( ttPOHeader.EntryPerson + '@...').
> > assign vSubject = vSubject + 'PO Num, ' + String(ttPOHeader.PONum) + ' is pending ' + vAuthName + '''s approval'.
> > assign vBody = vBody + 'Please review PO Num, ' + String(ttPOHeader.PONum) + ' for ' + ttPOHeader.EntryPerson .
> >
> > run SendEmail in hEmailEx (
> > false,
> > CUR-COMP,
> > vFrom,
> > vTo,
> > vCC,
> > vSubject,
> > vBody,
> > String( ttPOHeader.ApprovalStatus )
> > ).
> > if valid-handle(hEmailEx) then delete procedure hEmailEx.
> > leave.
> > end.
> >
> > Once the PO has been approved we wanted an email sent back to the buyer to let them know so...
> >
> > BO.Method: POApvMsg.Update
> >
> > PreProcess Conditions: the ttPOApvMsg.ApproverResponse field has been changed from any to any
> > or the ttPOApvMsg.ApproverResponse field has been changed from ? to any
> > or the ttPOApvMsg.ApproverResponse field has been changed from '' to any (This is likely overkill but it gets the job done and I haven't taken time to go back and clean it up)
> >
> > PreProcess Actions: enable dependent post process directives
> >
> > PostProcess Conditions: this directive has been enabled from the POApprovalEmail directive
> >
> > PostProcess Actions: (4GL Code)
> >
> > for each ttPOApvMsg where ttPOApvMsg.ApproverResponse <> '' no-lock, each POHeader where POHeader.Company = ttPOApvMsg.Company and POHeader.PONum = ttPOApvMsg.PONum no-lock.
> >
> > 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 = 'vantage@'.
> > assign vTo = POHeader.EntryPerson + '@...'.
> > assign vCC = vCC + ttPOApvMsg.DcdUserID + '@...'.
> > assign vSubject = vSubject + 'Your PO Num, ' + String(ttPOApvMsg.PONum) + ' has been ' + ttPOApvMsg.ApproverResponse.
> > assign vBody = vBody + ttPOApvMsg.MsgText.
> >
> > run SendEmail in hEmailEx (
> > false,
> > CUR-COMP,
> > vFrom,
> > vTo,
> > vCC,
> > vSubject,
> > vBody,
> > ttPOApvMsg.MsgText
> > ).
> > if valid-handle(hEmailEx) then delete procedure hEmailEx.
> > leave.
> > end.
> >
> > Hope this stirs the creative juices...
> >
> > NB
> >
> >
> >
> > --- In vantage@yahoogroups.com, "Gerry Loranger" <gloranger@> wrote:
> > >
> > > Hi Lissette. It is Pre.
> > >
> > >
> > >
> > > Gerry
> > >
> > >
> > >
> > >
> > >
> > > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> > > liss_c
> > > Sent: Wednesday, December 09, 2009 5:57 PM
> > > To: vantage@yahoogroups.com
> > > Subject: [Vantage] Re: PO Approval Emails
> > >
> > >
> > >
> > >
> > >
> > > HI Gerry,
> > >
> > > Is your method directive pre. post or base processing. I am testing out this
> > > cause i need to sen email alerts for PO approvals and Requisitions
> > > Dispatching.
> > >
> > > thanks,
> > >
> > > Lissette C.
> > >
> > > --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Gerry
> > > Loranger" <gloranger@> wrote:
> > > >
> > > > Hello, I use a Method Directive on PO.Update.
> > > >
> > > >
> > > >
> > > > The condition is: the POHeader.Approve field of the changed row is equal
> > > to
> > > > the True value
> > > >
> > > >
> > > >
> > > > and the Actions is: send e-mail synchronously based on the EmailPOApprover
> > > > template
> > > >
> > > >
> > > >
> > > > The email template is as follows:
> > > >
> > > >
> > > >
> > > > PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> > > > <EntryPerson/>.
> > > >
> > > >
> > > >
> > > > This PO totals $<POTotal/> (<MyCurrencyCode/>)
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Gerry
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> > > Behalf Of
> > > > idiabos
> > > > Sent: Wednesday, December 09, 2009 10:51 AM
> > > > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > > > Subject: [Vantage] PO Approval Emails
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > > I was wonder if Vantage was setup to automatically send emails for PO
> > > > Approvals based on the Buyer Setup table. Or will I need to create a BPM
> > > to
> > > > handle this? Thanks in advance!!
> > > >
> > > > -Sal
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>
THANKS a TON Gerry!!! I appreciate you sharing this with me. It gave me a great understanding of what a BPM can do and it's capabilities!! Thanks again brother!

-Sal

--- In vantage@yahoogroups.com, "Gerry Loranger" <gloranger@...> wrote:
>
> Hello, I use a Method Directive on PO.Update.
>
>
>
> The condition is: the POHeader.Approve field of the changed row is equal to
> the True value
>
>
>
> and the Actions is: send e-mail synchronously based on the EmailPOApprover
> template
>
>
>
> The email template is as follows:
>
>
>
> PO:<PONo/> for vendor <VendorName/> has been submitted for approval by
> <EntryPerson/>.
>
>
>
> This PO totals $<POTotal/> (<MyCurrencyCode/>)
>
>
>
>
>
> Gerry
>
>
>
>
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> idiabos
> Sent: Wednesday, December 09, 2009 10:51 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] PO Approval Emails
>
>
>
>
>
> Hello,
>
> I was wonder if Vantage was setup to automatically send emails for PO
> Approvals based on the Buyer Setup table. Or will I need to create a BPM to
> handle this? Thanks in advance!!
>
> -Sal
>
>
>
>
>
> [Non-text portions of this message have been removed]
>