Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

E-Mail Notification for Purchase Requisition

Status
Not open for further replies.

dbendell

MIS
Jan 27, 2003
2
0
0
US
I need some assistance modifying the following code to work for Requisitions instead of Purchase Orders. Can anyone offer some help with the appropriate corresponding fields for a Requisition?


define variable vapprov 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.
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 = email@removed '.
assign vTo = vapprov.
assign vCC = '.
assign vSubject = vSubject + 'Purchase Order ' +
string(ttPOHeader.PONUM) + '
needs approval'.
assign vBody = vBody + 'Insert info here'.
run SendEmail in hEmailEx (
false,
CUR-COMP,
vFrom,
vTo,
vCC,
vSubject,
vBody,
""
).
if valid-handle(hEmailEx) then delete procedure hEmailEx.
leave.
end.
end.
end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top