Ah!!!!
Try changing it to trigger based on the UnitCost. This will cause the alert
to work regardless of the "new" status. For example someone enters it
correctly, and then at a later date changes something. It also should have
the effect of fixing the line triggering before a quantity is defined.
If that does not work as desired, try triggering it with the XOrderQty
field. That way it is not triggered until the quantity is filled in.
You can filter out repeated runs by looking at the OldUnitCost, or
OldXOrderQty fields for <= 0.
Give it a shot and let me know.
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Lepley, Scott A.
Sent: Thursday, January 26, 2006 1:05 PM
To: 'vantage@yahoogroups.com'
Subject: RE: [Vantage] BAM alert regarding purchase price increase
Aaron,
I am monitoring only one field, PODetail.POLine, for changes. To the best
of my knowledge, this should cause the BAM code to run for EVERY NEW
purchase order line but only trigger the alert message if the ordered part
exists in the part table, has a last unit cost greater than 0 AND has a
current unit cost greater than or equal to 105% of the last unit cost.
Regards,
Scott
-----Original Message-----
From: Aaron Hoyt [mailto:aaron.hoyt@...]
Sent: Thursday, January 26, 2006 10:08 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BAM alert regarding purchase price increase
Scott,
What fields do you have included in the BAM to trigger this alert?
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Lepley, Scott A.
Sent: Thursday, January 26, 2006 9:29 AM
To: 'vantage@yahoogroups.com'
Subject: [Vantage] BAM alert regarding purchase price increase
OK, here's another BAM alert question for consideration. Can anyone tell me
why the following code would have the result of ALWAYS showing in the alert
message an ordered quantity of 0 (see example below) instead of the actual
ordered quantity? It may be a simple problem, but if it is then I'm
obviously not seeing it.
/* This email alert is triggered when a PO line price is greater than or
equal to 105% of the last cost */
{ud/GlbAlert.i &TableName = "PODetail"}
FIND Part WHERE Part.Company = PODetail.Company AND Part.PartNum =
PODetail.PartNum NO-LOCK NO-ERROR.
IF NOT AVAILABLE Part THEN RETURN "Cancel Send".
DEFINE VARIABLE LastTotalCost AS DECIMAL.
ASSIGN LastTotalCost = (Part.LastMaterialCost + Part.LastMtlBurCost +
Part.LastLaborCost + Part.LastBurdenCost + Part.LastSubContCost).
IF LastTotalCost > 0 AND PODetail.UnitCost >= (1.05 * LastTotalCost) THEN
DO:
/* Set the To: recipient of the email */
ASSIGN Email-To = "sal@...".
/* Set the subject of the email */
ASSIGN Email-Subject = "Significant price increase for " +
(PODetail.PartNum) + ", " + (PODetail.LineDesc).
/* Set the email type to be HTML */
ASSIGN Email-Mime-Header = {&HTML-Mime}.
/* Set the body of the email */
ASSIGN Email-Text = "Please note that " + string(PODetail.XOrderQty) + " " +
(PODetail.IUM) + " of " + (PODetail.PartNum) + ", " + (PODetail.LineDesc) +
", has/have just been ordered and that the current price for this material
is at least 5% more than the last price paid for it. For more information,
see line #" + string(PODetail.POLine) + " of purchase order #" +
string(PODetail.PONum) + ".".
END.
ELSE DO:
Return Error.
END.
Regards,
Scott
[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/.
(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/links
Yahoo! Groups Links
Try changing it to trigger based on the UnitCost. This will cause the alert
to work regardless of the "new" status. For example someone enters it
correctly, and then at a later date changes something. It also should have
the effect of fixing the line triggering before a quantity is defined.
If that does not work as desired, try triggering it with the XOrderQty
field. That way it is not triggered until the quantity is filled in.
You can filter out repeated runs by looking at the OldUnitCost, or
OldXOrderQty fields for <= 0.
Give it a shot and let me know.
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Lepley, Scott A.
Sent: Thursday, January 26, 2006 1:05 PM
To: 'vantage@yahoogroups.com'
Subject: RE: [Vantage] BAM alert regarding purchase price increase
Aaron,
I am monitoring only one field, PODetail.POLine, for changes. To the best
of my knowledge, this should cause the BAM code to run for EVERY NEW
purchase order line but only trigger the alert message if the ordered part
exists in the part table, has a last unit cost greater than 0 AND has a
current unit cost greater than or equal to 105% of the last unit cost.
Regards,
Scott
-----Original Message-----
From: Aaron Hoyt [mailto:aaron.hoyt@...]
Sent: Thursday, January 26, 2006 10:08 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BAM alert regarding purchase price increase
Scott,
What fields do you have included in the BAM to trigger this alert?
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Lepley, Scott A.
Sent: Thursday, January 26, 2006 9:29 AM
To: 'vantage@yahoogroups.com'
Subject: [Vantage] BAM alert regarding purchase price increase
OK, here's another BAM alert question for consideration. Can anyone tell me
why the following code would have the result of ALWAYS showing in the alert
message an ordered quantity of 0 (see example below) instead of the actual
ordered quantity? It may be a simple problem, but if it is then I'm
obviously not seeing it.
/* This email alert is triggered when a PO line price is greater than or
equal to 105% of the last cost */
{ud/GlbAlert.i &TableName = "PODetail"}
FIND Part WHERE Part.Company = PODetail.Company AND Part.PartNum =
PODetail.PartNum NO-LOCK NO-ERROR.
IF NOT AVAILABLE Part THEN RETURN "Cancel Send".
DEFINE VARIABLE LastTotalCost AS DECIMAL.
ASSIGN LastTotalCost = (Part.LastMaterialCost + Part.LastMtlBurCost +
Part.LastLaborCost + Part.LastBurdenCost + Part.LastSubContCost).
IF LastTotalCost > 0 AND PODetail.UnitCost >= (1.05 * LastTotalCost) THEN
DO:
/* Set the To: recipient of the email */
ASSIGN Email-To = "sal@...".
/* Set the subject of the email */
ASSIGN Email-Subject = "Significant price increase for " +
(PODetail.PartNum) + ", " + (PODetail.LineDesc).
/* Set the email type to be HTML */
ASSIGN Email-Mime-Header = {&HTML-Mime}.
/* Set the body of the email */
ASSIGN Email-Text = "Please note that " + string(PODetail.XOrderQty) + " " +
(PODetail.IUM) + " of " + (PODetail.PartNum) + ", " + (PODetail.LineDesc) +
", has/have just been ordered and that the current price for this material
is at least 5% more than the last price paid for it. For more information,
see line #" + string(PODetail.POLine) + " of purchase order #" +
string(PODetail.PONum) + ".".
END.
ELSE DO:
Return Error.
END.
Regards,
Scott
[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/.
(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/links
Yahoo! Groups Links