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:
Behalf Of
-----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:
>[mailto:vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com] On
> Hi Lissette. It is Pre.
>
>
>
> Gerry
>
>
>
>
>
> From: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
Behalf Of
> liss_cthis
> 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
> cause i need to sen email alerts for PO approvals and Requisitions<mailto:vantage%40yahoogroups.com> , "Gerry
> Dispatching.
>
> thanks,
>
> Lissette C.
>
> --- In vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
> Loranger" <gloranger@> wrote:EmailPOApprover
> >
> > 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
> > template<mailto:vantage%40yahoogroups.com>
> >
> >
> >
> > 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@yahoogroups <mailto:vantage%40yahoogroups.com> .com<mailto:vantage%40yahoogroups.com> ] On
> Behalf Of<mailto:vantage%40yahoogroups.com>
> > idiabos
> > Sent: Wednesday, December 09, 2009 10:51 AM
> > To: vantage@yahoogroups <mailto:vantage%40yahoogroups.com> .com
> > Subject: [Vantage] PO Approval Emails[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
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>