Include specific info on BAM Alerts

I use the same approval process and ran into the same limitation. So I set
up a Method Directive. I could send it to you if you like.



Gerry



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Cheryl Elliott
Sent: Friday, October 16, 2009 10:46 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Include specific info on BAM Alerts





We are implementing the approval system for Purchase Orders, and want the
system to alert the buyer whenever a PO has been approved. The BAM works
properly, but does not include the PO number and the buyers would like to
have the particular PO referenced in their alerts. Any ideas? I see there is
the possibility of triggering an "Additional Alert Program" but with my
limited programming skills, I can't imagine anything helpful coming from
"outside" that way...





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



Here's a very simple example of how you could include additional info in
your emails...



{ud/GlbAlert.i & TableName = "JobHead"}

Assign Email-Text = "The following is ready for receipt to stock;" +
"~tJob Number: " + string(JobHead.JobNum)

+ "~n~t~t~t~t~t~t~t~tPart Number: " + string(JobHead.PartNum)

+ "~n~t~t~t~t~t~t~t~tRevision: " + string(JobHead.Revision).



Put this into notepad...save it as a filename.p



Save this to your Epicor server installation location
\\Yourserver\epicor\Mfgsys803\Server\UD\filename.p
<file:///\\Yourserver\epicor\Mfgsys803\Server\UD\filename.p>



You will reference this file via a UNC file path in your BAM setup form.



Replace the table and field information with the ones you are using in
your BAM (look to italicized text). You can add variables as well as
4GL queries to bring in data from tables unrelated to the current
transaction.



The "~nt" junk is just formatting text. You can learn more about that
from the 4GL reference and handbooks.

Rob Bucek

Manufacturing Engineer

PH: (715) 284-5376 ext 3111

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Cheryl Elliott
Sent: Friday, October 16, 2009 9:46 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Include specific info on BAM Alerts





We are implementing the approval system for Purchase Orders, and want
the system to alert the buyer whenever a PO has been approved. The BAM
works properly, but does not include the PO number and the buyers would
like to have the particular PO referenced in their alerts. Any ideas? I
see there is the possibility of triggering an "Additional Alert Program"
but with my limited programming skills, I can't imagine anything helpful
coming from "outside" that way...





[Non-text portions of this message have been removed]
Here's some 4GL Code that will do it:

{ud/GlbAlert.i &TableName = "POHeader"}

DEFINE VARIABLE POAmount AS DECIMAL NO-UNDO.
DEFINE VARIABLE PONumber AS DECIMAL NO-UNDO.
DEFINE VARIABLE Company AS CHARACTER NO-UNDO.
DEFINE VARIABLE ApprovalStatus AS CHARACTER NO-UNDO.

PONumber = POHeader.PONum.
Company = POHeader.Company.
ApprovalStatus = POHeader.ApprovalStatus.

message "PONum: " + string(PONumber) + "~n".
message "ApprovalStatus: " + ApprovalStatus + "~n".

find PODetail where (PODetail.Company = POHeader.Company) and (PODetail.PONum = POHeader.PONum) no-lock no-error.
for each PODetail of POHeader:
POAmount = POAmount + (PODetail.DocUnitCost * PODetail.OrderQty).
end.

find POApvMsg where (POApvMsg.Company = POHeader.Company) and (POApvMsg.PONum = POHeader.PONum)
and POApvMsg.MsgType = "1" no-lock no-error.

if available POApvMsg then do:
message "PONum: " + string(POApvMsg.PONum) + " MsgTo: " + POApvMsg.MsgTo.
find PurAgent where (PurAgent.Company = POHeader.Company) and (PurAgent.BuyerId = POApvMsg.MsgTo) no-lock no-error.
if available PurAgent then do:
find Vendor where (Vendor.Company = POHeader.Company) and (Vendor.VendorNum = POHeader.VendorNum) no-lock no-error.
if available Vendor then do:
message "Approver E-Mail: " + PurAgent.EmailAddress.
message "Vendor: " + Vendor.Name + " (" + Vendor.VendorID + ")".
Assign Email-From = "vantage-alerts@...".
Assign Email-To = PurAgent.EmailAddress.
Assign Email-Subject = POHeader.Company + " Purchase Order Approval Status Notification".
Assign Email-Text = "Purchase Order " + string(POHeader.PONum) + " has been approved.~n"
+ "----------~n"
+ "Company: " + POHeader.Company + "~n"
+ "Vendor: " + Vendor.Name + " (" + Vendor.VendorID + ")~n"
+ "POAmount: " + TRIM(string(POAmount, "$>>>,>>>,>>9.99")) + "~n"
+ "Buyer: " + POHeader.BuyerID + "~n"
+ "PODate: " + string(POHeader.OrderDate) + "~n"
+ "Approver: " + PurAgent.Name + " [" + PurAgent.BuyerID + "] <" + PurAgent.EmailAddress + ">~n"
+ "Comments: ~n" + POHeader.CommentText + "~n".
if (POApvMsg.MsgText <> "") then do:
Assign Email-Text = Email-Text + "Approval Message Log: ~n" + POApvMsg.MsgText + "~n".
end.
message "Email-Text: " + Email-Text.
end.
end.
end.

Save this in your mfgsys803\server\ud folder as a .P file, and point to it in your BAM. If you do a BAM alert on the POHeader.ApprovalStatus field and filter on ApprovalStatus = 'A' you should get what you expect: buyers will get notified when their POs have been approved.

I also developed a more complete solution so that approvers also get notified all the way up the approval chain, and then the buyer gets notified at the end.

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Cheryl Elliott
Sent: Friday, October 16, 2009 10:46 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Include specific info on BAM Alerts

We are implementing the approval system for Purchase Orders, and want the system to alert the buyer whenever a PO has been approved. The BAM works properly, but does not include the PO number and the buyers would like to have the particular PO referenced in their alerts. Any ideas? I see there is the possibility of triggering an "Additional Alert Program" but with my limited programming skills, I can't imagine anything helpful coming from "outside" that way...


------------------------------------

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links