Thank you Greg
Regards,
Miguel A. Santillan
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Greg Payne
Sent: Wednesday, June 06, 2012 8:00 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] RE: BPM: PO Rel Due Date Change
If you want to do via bpm, there is an example under http://tech.groups.yahoo.com/group/vantage/files/BPMs AdvEmailex.bpm<http://tech.groups.yahoo.com/group/vantage/files/BPMs%20AdvEmailex.bpm>. I got it from support last year.
I do this kind of alert in a .p program called from a BAM. You enter the alert and then enter the path to the .p in the additional alert procedure. Typically the path is \\server\epicor905\Server\ud\procedurename.p<file:///<file:///\\>\\server\epicor905\Server\ud\procedurename.p>
I referenced BAM_Alert_OrderRel_DropShip.zip under files and some others I found originally. I use for Tasks as it gets much more detail to the users.
I had one on PODetail and tweaked it for PORel. When I was troubleshooting, if I included PreviousDueDate the email didn't fire and when I looked at the data it was null in sql and ? in the server log.
I like that in a BAM that all of the OLD values are available as OLDTablename.field, so you can alert on the date being changed or that the Hot Shortage Checkbox has be set or unset.
the commented lines at the end are conditions where we send the alert conditionally to other users. You can also set the sendmail = false to not send the email.
I use UltraEdit to edit the .p procedure instead of the progress editor, it highlights syntax and has line numbers. You will also need a text file viewer to view the app server log file for errors.
Contact me offline if you want more details.
Greg
Code below - Save into a name.p program in your sever\ud folder. I also uploaded to progress section of files as SendPOReleaseChange.p
----------------------------------------------------------
{ud/GlbAlert.i &TableName = "PORel"}
ASSIGN SendEmail = FALSE.
/* format Email Text */
define variable TotQty as decimal no-undo initial 0.
define variable TotStd as decimal no-undo initial 0.
define variable CostAtStd as decimal no-undo initial 0.
define variable CostAtPO as decimal no-undo initial 0.
define variable POQty as decimal no-undo initial 0.
define variable STDVariance as decimal no-undo initial 0.
define variable STDMaterialCost as decimal no-undo initial 0.
define variable EmailAddress as Character no-undo initial '':U.
define variable UserName as Character no-undo initial '':U.
define variable vFrom as character no-undo initial '':U.
define variable vTo as character no-undo initial '':U.
define variable vCC as character no-undo initial '':U.
define variable vSubject as character no-undo initial '':U.
define variable vBody as character no-undo initial '':U.
/* You can reference any Changed data on the Table name on line 1 as OLDTablename.Fieldname */
Find UserFile where UserFile.DCDUserID = DCD-UserID no-error.
Find PODetail no-lock where PODetail.company = PORel.Company and PODetail.PONum = PORel.PONum.
Find Vendor no-lock where Vendor.company = PODetail.Company and Vendor.VendorNum = PODetail.VendorNum.
Message "DEBUG Email - PO Quantity = " + string(PODetail.XOrderQty).
Assign vBody = "PO Date changed on " + string(PODetail.PONum) + " by " + UserFile.Name +
"~n~n~tVendor " + Vendor.VendorID +
"~n~n~tItem " + PODetail.PartNum + " " + PODetail.LineDesc +
"~n~n~tQty " + trim(string(PODetail.XOrderQty)) +
"~n~tPO Cost ~t" + string(PODetail.UnitCost,"$>>>,>>>,>>9.99") + "~tExtended Cost " + TRIM(string(PODetail.UnitCost * PODetail.XOrderQty,"$>>>,>>>,>>9.99")) +
"~n~n~tNew Release Due Date " + string(PORel.DueDate,"99/99/99") +
/* "~n~n~tPrevious Release Due Date " + string(PORel.PreviousDueDate,"99/99/99") + */
"~n~n~tOld Release Due Date " + string(OLDPORel.DueDate,"99/99/99") +
"~n~n~tPromise Release Due Date " + string(PORel.PromiseDt,"99/99/99") +
"~n~n~tPurchase Order Number: " + string(PODetail.PONUM) + "~tLine Number: " + string(PODetail.POLine).
assign vTO = "info@...<mailto:info%40domain.com>"
vCC = "info@...<mailto:info%40domain.com>;".
/* if (CostAtPO - CostAtStd) > 50 then do:
assign vTO = vTO + "info@...<mailto:info%40domain.com>;".
end.
*/
/* if (CostAtPO - CostAtStd) > 1000 then do:
assign vCC = vCC + "user@...<mailto:user%40domain.com>;".
end.
*/
Message "DEBUG Email - Previous Due Date = " + string(PORel.PreviousDueDate,"99/99/99").
assign EMAIL-From = UserFile.EmailAddress.
EMAIL-To = vTO.
EMAIL-CC = vCC + EMAIL-From.
assign EMAIL-Subject = 'PO Rel Date Changed : ' + PODetail.PartNum.
assign EMAIL-Text = vBody.
assign SendEmail = true.
Stop Code
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of Miguel Santillan
Sent: Tuesday, June 05, 2012 10:38 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] RE: BPM: PO Rel Due Date Change
Yes. Epicor just told me that I need to write 4Gl code to pull information over from cross tables. Never done that before...
Regards,
Miguel A. Santillan
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>] On Behalf Of John Driggers
Sent: Tuesday, June 05, 2012 7:36 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] RE: BPM: PO Rel Due Date Change
If you look at the actual table, is the information there?
Regards,
Miguel A. Santillan
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Greg Payne
Sent: Wednesday, June 06, 2012 8:00 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] RE: BPM: PO Rel Due Date Change
If you want to do via bpm, there is an example under http://tech.groups.yahoo.com/group/vantage/files/BPMs AdvEmailex.bpm<http://tech.groups.yahoo.com/group/vantage/files/BPMs%20AdvEmailex.bpm>. I got it from support last year.
I do this kind of alert in a .p program called from a BAM. You enter the alert and then enter the path to the .p in the additional alert procedure. Typically the path is \\server\epicor905\Server\ud\procedurename.p<file:///<file:///\\>\\server\epicor905\Server\ud\procedurename.p>
I referenced BAM_Alert_OrderRel_DropShip.zip under files and some others I found originally. I use for Tasks as it gets much more detail to the users.
I had one on PODetail and tweaked it for PORel. When I was troubleshooting, if I included PreviousDueDate the email didn't fire and when I looked at the data it was null in sql and ? in the server log.
I like that in a BAM that all of the OLD values are available as OLDTablename.field, so you can alert on the date being changed or that the Hot Shortage Checkbox has be set or unset.
the commented lines at the end are conditions where we send the alert conditionally to other users. You can also set the sendmail = false to not send the email.
I use UltraEdit to edit the .p procedure instead of the progress editor, it highlights syntax and has line numbers. You will also need a text file viewer to view the app server log file for errors.
Contact me offline if you want more details.
Greg
Code below - Save into a name.p program in your sever\ud folder. I also uploaded to progress section of files as SendPOReleaseChange.p
----------------------------------------------------------
{ud/GlbAlert.i &TableName = "PORel"}
ASSIGN SendEmail = FALSE.
/* format Email Text */
define variable TotQty as decimal no-undo initial 0.
define variable TotStd as decimal no-undo initial 0.
define variable CostAtStd as decimal no-undo initial 0.
define variable CostAtPO as decimal no-undo initial 0.
define variable POQty as decimal no-undo initial 0.
define variable STDVariance as decimal no-undo initial 0.
define variable STDMaterialCost as decimal no-undo initial 0.
define variable EmailAddress as Character no-undo initial '':U.
define variable UserName as Character no-undo initial '':U.
define variable vFrom as character no-undo initial '':U.
define variable vTo as character no-undo initial '':U.
define variable vCC as character no-undo initial '':U.
define variable vSubject as character no-undo initial '':U.
define variable vBody as character no-undo initial '':U.
/* You can reference any Changed data on the Table name on line 1 as OLDTablename.Fieldname */
Find UserFile where UserFile.DCDUserID = DCD-UserID no-error.
Find PODetail no-lock where PODetail.company = PORel.Company and PODetail.PONum = PORel.PONum.
Find Vendor no-lock where Vendor.company = PODetail.Company and Vendor.VendorNum = PODetail.VendorNum.
Message "DEBUG Email - PO Quantity = " + string(PODetail.XOrderQty).
Assign vBody = "PO Date changed on " + string(PODetail.PONum) + " by " + UserFile.Name +
"~n~n~tVendor " + Vendor.VendorID +
"~n~n~tItem " + PODetail.PartNum + " " + PODetail.LineDesc +
"~n~n~tQty " + trim(string(PODetail.XOrderQty)) +
"~n~tPO Cost ~t" + string(PODetail.UnitCost,"$>>>,>>>,>>9.99") + "~tExtended Cost " + TRIM(string(PODetail.UnitCost * PODetail.XOrderQty,"$>>>,>>>,>>9.99")) +
"~n~n~tNew Release Due Date " + string(PORel.DueDate,"99/99/99") +
/* "~n~n~tPrevious Release Due Date " + string(PORel.PreviousDueDate,"99/99/99") + */
"~n~n~tOld Release Due Date " + string(OLDPORel.DueDate,"99/99/99") +
"~n~n~tPromise Release Due Date " + string(PORel.PromiseDt,"99/99/99") +
"~n~n~tPurchase Order Number: " + string(PODetail.PONUM) + "~tLine Number: " + string(PODetail.POLine).
assign vTO = "info@...<mailto:info%40domain.com>"
vCC = "info@...<mailto:info%40domain.com>;".
/* if (CostAtPO - CostAtStd) > 50 then do:
assign vTO = vTO + "info@...<mailto:info%40domain.com>;".
end.
*/
/* if (CostAtPO - CostAtStd) > 1000 then do:
assign vCC = vCC + "user@...<mailto:user%40domain.com>;".
end.
*/
Message "DEBUG Email - Previous Due Date = " + string(PORel.PreviousDueDate,"99/99/99").
assign EMAIL-From = UserFile.EmailAddress.
EMAIL-To = vTO.
EMAIL-CC = vCC + EMAIL-From.
assign EMAIL-Subject = 'PO Rel Date Changed : ' + PODetail.PartNum.
assign EMAIL-Text = vBody.
assign SendEmail = true.
Stop Code
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of Miguel Santillan
Sent: Tuesday, June 05, 2012 10:38 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] RE: BPM: PO Rel Due Date Change
Yes. Epicor just told me that I need to write 4Gl code to pull information over from cross tables. Never done that before...
Regards,
Miguel A. Santillan
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>] On Behalf Of John Driggers
Sent: Tuesday, June 05, 2012 7:36 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] RE: BPM: PO Rel Due Date Change
If you look at the actual table, is the information there?
On Tue, Jun 5, 2012 at 10:29 AM, Miguel Santillan <msantillan@...<mailto:msantillan%40ccicms.com><mailto:msantillan%40ccicms.com>>wrote:
> **
>
>
> Anyone?
>
> From: Miguel Santillan
> Sent: Friday, June 01, 2012 9:18 AM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com>
> Subject: BPM: PO Rel Due Date Change
>
>
> I have a Pre-Process BPM on PO.Update.
>
> The trigger is working and I get the emails, but not all my data is
> appearing in the email.
>
> Example:
> Conditions:
> the ttPORel.DueDate field has been changed from any to any AND number
> of rows in the 'chkHtSht' query is not less than 1
>
> chksht: Checking if the Hot Shortage Checkbox is checked. Everything
> after CheckBox01=yes was added to try to solve this problem I am having.
>
> for each ttPOREL where (ttPoRel.RowMod = 'U') and ttPORel.CheckBox01 =
> yes, each PODetail where (ttporel.Company = PODetail.Company and
> ttporel.PONum = PODetail.PONum and ttporel.POLine = PODetail.POLine)
> no-lock
>
> Actions:
> Send e-mail synchronously based on the Email Template
>
> The email is missing data.
>
> The following PO Due Date has been changed
>
> PO: 130637 from PORel.PoNum
>
> Line: 1 from PORel.POLine
>
> Rel: 1 from PORel.PORelNum
>
> Part: from PODetail.PartNum
>
> Desc: from PODetail.LineDesc
>
> Qty: 66 from PORel.XQtyRel
>
> New Date: 7/20/2012 from PORel.DueDate (New Value)
>
> Prev Date: from PORel.PrevDueDate, it is in the table, but not
> displaying
>
> What link am I missing.
>
> Regards,
>
> Miguel A. Santillan
>
> [Non-text portions of this message have been removed]
>
>
>
--
*John Driggers*
*High End Dev, System Design, Profit Drinking*
*
**:: 904.404.9233*
*:: waffqle@...<mailto:waffqle%40gmail.com><mailto:waffqle%40gmail.com>*
*:: NO FAXES*
*
*
[Non-text portions of this message have been removed]
------------------------------------
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/.<http://groups.yahoo.com/group/vantage/files/><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
________________________________
CONFIDENTIALITY NOTICE
The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at (727) 578-6258 and immediately delete the communication.
"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]