BAM alert regarding purchase price increase

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
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



-----Original Message-----
From: System Alert [mailto:VantageSystem@...]
Sent: Thursday, January 26, 2006 8:43 AM
To: sal@...
Subject: Significant price increase for 81-31-880, FERRULE, H1.5/16 16 AWG
RED WEIDMULLER



Please note that 0 EA of 81-31-880, FERRULE, H1.5/16 16 AWG RED WEIDMULLER,
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 #1 of purchase order #103092.





[Non-text portions of this message have been removed]
Scott,
I would be suspicious, as with one of the alerts that I have created, that
your alert is triggered before the event that updates the field.
I am not sure how to check for this, but it would be my suspicion.
That is just a first guess.
I hope someone else sees something more obvious and easier to fix.
Good luck,
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



-----Original Message-----
From: System Alert [mailto:VantageSystem@...]
Sent: Thursday, January 26, 2006 8:43 AM
To: sal@...
Subject: Significant price increase for 81-31-880, FERRULE, H1.5/16 16 AWG
RED WEIDMULLER



Please note that 0 EA of 81-31-880, FERRULE, H1.5/16 16 AWG RED WEIDMULLER,
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 #1 of purchase order #103092.





[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
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
My guess is that since the XOrderQty is maintained by the OrderRel Quantities that working off the idea of parent tables need to exist before the child is created and Aaron about the trigger running before data is updated..... Is it possible that when the user accepts the OrderDtl that Progress wants to create the OrderDtl record first (which triggers the BAM), and then Progress creates the OrderRel records which would then populate the OrderDtl XOrderQty based upon their quantity, but this is happening after the BAM has already ran. What if the BAM was triggered on the OrderRel table and queried the OrderDtl table? This might then populate the XOrderQty field, but it would probably also execute the BAM for each release. :( If it is the case that the BAM executes before the data is populated, my thoughts would be to create some sort of delay timer that actually triggers the query 1 minute after it was actually created, I would then hope Progress has all the field data populated with the correct values.

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of Aaron Hoyt
Sent: Thursday, January 26, 2006 8:44 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BAM alert regarding purchase price increase


Scott,
I would be suspicious, as with one of the alerts that I have created, that
your alert is triggered before the event that updates the field.
I am not sure how to check for this, but it would be my suspicion.
That is just a first guess.
I hope someone else sees something more obvious and easier to fix.
Good luck,
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



-----Original Message-----
From: System Alert [mailto:VantageSystem@...]
Sent: Thursday, January 26, 2006 8:43 AM
To: sal@...
Subject: Significant price increase for 81-31-880, FERRULE, H1.5/16 16 AWG
RED WEIDMULLER



Please note that 0 EA of 81-31-880, FERRULE, H1.5/16 16 AWG RED WEIDMULLER,
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 #1 of purchase order #103092.





[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










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
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]