Notify when part goes under Minimum Qty

If I change the tablename to "PartPlant" the file will still error out because the IF statement needs to compare values from both the PartPlant and the PartWhse table. This is what is causing me the headaches. I do not know how to construct the file so it can compare the values from two different tables in an IF statement for one part number.

The PartWhse.OnHandQty is a sum of all the bins in the warehouse for that part. This is exactly what we are after. We don't care if the parts are spread out over several bins, we just want to know when the total parts in all bins falls below the PartPlant.MinumumQty.

Thanks,

Dale

>>> wirch@... 12/28/2005 3:41:26 PM >>>

Hi Dale,

Progress is not my chosen platform so I might be wrong, but do you need
to change the tablename on the following line?

{ud/GlbAlert.i & TableName = "partwhse"} to {ud/GlbAlert.i & TableName =
"partplant"}

Also, when I look through my extract for the partplant table I don't see
an OnHandQty. If memory serves Vantage tracks bin-lot and warehouse
onhand, but not plant onhand. Presumably you have the plant on-hand in
the bin, and want the partbin table instead?

Happy holidays,

Steve


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of tmsover
Sent: Wednesday, December 28, 2005 3:30 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Notify when part goes under Minimum Qty

I need help with a .P file.

I have created a BAM which triggers off the PartWhse.OnHandQty field
to run this .P file. The following code actually works. The problem
is they have now changed the field it needs to evaluate. We use
different values in PartWhse.MinimumQty and PartPlant.MinimumQty for
diffent purposes.

Below you will see
"IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)"

but what I really need is
"IF (PartWhse.OnHandQty <= PartPlant.MinimumQty)"

If I use the second line I get an error when it runs. Is there a way
to modify the file below to achieve this?

Any help is appreciated.

Dale Norris
IS Manager
Bullen Ultrasonics


***************************************************
My existing file
***************************************************\

/* BAM-PartUnderMin.p */
/* Preparred by Dale Norris 12/14/05*/
/* rev 0 - initial release */

/* Assign the include file */
{ud/GlbAlert.i & TableName = "partwhse"}

/* Define Variables*/
DEFINE VARIABLE buyername AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.
DEFINE VARIABLE buyeremail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.

/* Check to see if onhand qty is equal to or below min, and if
so */
/* find the name and email address of the buyerid and create an email
notificatioin */

IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)
THEN DO:
FIND Part WHERE (Part.Company = PartWhse.Company) AND
(Part.PartNum = PartWhse.PartNum)
NO-LOCK.
FIND PartClass WHERE (PartClass.Company = Part.Company) AND
(PartClass.Class = Part.Class)
NO-LOCK.
FIND PurAgent WHERE (PurAgent.Company = PartClass.Company) AND
(PurAgent.BuyerID = PartClass.BuyerID)
NO-LOCK.
IF PurAgent.name <> ""
THEN DO:
buyername = STRING(PurAgent.NAME).
buyeremail = STRING(PurAgent.EMailAddress).
Assign Email-To = STRING(Puragent.EmailAddress)
Email-Subject = "Part number " + STRING
(part.partnum)
Email-Text = "~nPart Number "+ STRING
(part.partnum) + " has fallen below it's minimum quantity of " +
STRING(PartWhse.MinimumQty) + " on " + STRING(TODAY)+ " at " + STRING
(TIME,"HH:MM AM")
+ "~n"
+ "~nPlease review this Part and
initiate an order if applicable".
END.
END.
ELSE DO:
RETURN "Cancel Send":U.
END.







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











[Non-text portions of this message have been removed]
I need help with a .P file.

I have created a BAM which triggers off the PartWhse.OnHandQty field
to run this .P file. The following code actually works. The problem
is they have now changed the field it needs to evaluate. We use
different values in PartWhse.MinimumQty and PartPlant.MinimumQty for
diffent purposes.

Below you will see
"IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)"

but what I really need is
"IF (PartWhse.OnHandQty <= PartPlant.MinimumQty)"

If I use the second line I get an error when it runs. Is there a way
to modify the file below to achieve this?

Any help is appreciated.

Dale Norris
IS Manager
Bullen Ultrasonics


***************************************************
My existing file
***************************************************\

/* BAM-PartUnderMin.p */
/* Preparred by Dale Norris 12/14/05*/
/* rev 0 - initial release */

/* Assign the include file */
{ud/GlbAlert.i & TableName = "partwhse"}

/* Define Variables*/
DEFINE VARIABLE buyername AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.
DEFINE VARIABLE buyeremail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.

/* Check to see if onhand qty is equal to or below min, and if
so */
/* find the name and email address of the buyerid and create an email
notificatioin */

IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)
THEN DO:
FIND Part WHERE (Part.Company = PartWhse.Company) AND
(Part.PartNum = PartWhse.PartNum)
NO-LOCK.
FIND PartClass WHERE (PartClass.Company = Part.Company) AND
(PartClass.Class = Part.Class)
NO-LOCK.
FIND PurAgent WHERE (PurAgent.Company = PartClass.Company) AND
(PurAgent.BuyerID = PartClass.BuyerID)
NO-LOCK.
IF PurAgent.name <> ""
THEN DO:
buyername = STRING(PurAgent.NAME).
buyeremail = STRING(PurAgent.EMailAddress).
Assign Email-To = STRING(Puragent.EmailAddress)
Email-Subject = "Part number " + STRING
(part.partnum)
Email-Text = "~nPart Number "+ STRING
(part.partnum) + " has fallen below it's minimum quantity of " +
STRING(PartWhse.MinimumQty) + " on " + STRING(TODAY)+ " at " + STRING
(TIME,"HH:MM AM")
+ "~n"
+ "~nPlease review this Part and
initiate an order if applicable".
END.
END.
ELSE DO:
RETURN "Cancel Send":U.
END.
Hi Dale,

Progress is not my chosen platform so I might be wrong, but do you need
to change the tablename on the following line?

{ud/GlbAlert.i & TableName = "partwhse"} to {ud/GlbAlert.i & TableName =
"partplant"}

Also, when I look through my extract for the partplant table I don't see
an OnHandQty. If memory serves Vantage tracks bin-lot and warehouse
onhand, but not plant onhand. Presumably you have the plant on-hand in
the bin, and want the partbin table instead?

Happy holidays,

Steve


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of tmsover
Sent: Wednesday, December 28, 2005 3:30 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Notify when part goes under Minimum Qty

I need help with a .P file.

I have created a BAM which triggers off the PartWhse.OnHandQty field
to run this .P file. The following code actually works. The problem
is they have now changed the field it needs to evaluate. We use
different values in PartWhse.MinimumQty and PartPlant.MinimumQty for
diffent purposes.

Below you will see
"IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)"

but what I really need is
"IF (PartWhse.OnHandQty <= PartPlant.MinimumQty)"

If I use the second line I get an error when it runs. Is there a way
to modify the file below to achieve this?

Any help is appreciated.

Dale Norris
IS Manager
Bullen Ultrasonics


***************************************************
My existing file
***************************************************\

/* BAM-PartUnderMin.p */
/* Preparred by Dale Norris 12/14/05*/
/* rev 0 - initial release */

/* Assign the include file */
{ud/GlbAlert.i & TableName = "partwhse"}

/* Define Variables*/
DEFINE VARIABLE buyername AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.
DEFINE VARIABLE buyeremail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.

/* Check to see if onhand qty is equal to or below min, and if
so */
/* find the name and email address of the buyerid and create an email
notificatioin */

IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)
THEN DO:
FIND Part WHERE (Part.Company = PartWhse.Company) AND
(Part.PartNum = PartWhse.PartNum)
NO-LOCK.
FIND PartClass WHERE (PartClass.Company = Part.Company) AND
(PartClass.Class = Part.Class)
NO-LOCK.
FIND PurAgent WHERE (PurAgent.Company = PartClass.Company) AND
(PurAgent.BuyerID = PartClass.BuyerID)
NO-LOCK.
IF PurAgent.name <> ""
THEN DO:
buyername = STRING(PurAgent.NAME).
buyeremail = STRING(PurAgent.EMailAddress).
Assign Email-To = STRING(Puragent.EmailAddress)
Email-Subject = "Part number " + STRING
(part.partnum)
Email-Text = "~nPart Number "+ STRING
(part.partnum) + " has fallen below it's minimum quantity of " +
STRING(PartWhse.MinimumQty) + " on " + STRING(TODAY)+ " at " + STRING
(TIME,"HH:MM AM")
+ "~n"
+ "~nPlease review this Part and
initiate an order if applicable".
END.
END.
ELSE DO:
RETURN "Cancel Send":U.
END.







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

You will need to find the correct PartPlant for the PartWhse first then test
as you desire. The following code should get you moving in the right
direction... (you will have to define your own current plant, replace the
???)

-------------------------
/* find the name and email address of the buyerid and create an email
notification */

FIND PartPlant WHERE (PartPlant.Company = PartWhse.Company) AND
(PartPlant.PartNum = PartWhse.PartNum) AND
(PartPlant.Plant = "???????") NO-LOCK.

IF (PartWhse.OnHandQty <= PartPlant.MinimumQty)
THEN DO:
FIND Part WHERE (Part.Company = PartWhse.Company) AND
(Part.PartNum = PartWhse.PartNum)
NO-LOCK.
------------------------

If you need more help, let me know.
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf
Of tmsover
Sent: Wednesday, December 28, 2005 3:30 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Notify when part goes under Minimum Qty


I need help with a .P file.

I have created a BAM which triggers off the PartWhse.OnHandQty field
to run this .P file. The following code actually works. The problem
is they have now changed the field it needs to evaluate. We use
different values in PartWhse.MinimumQty and PartPlant.MinimumQty for
diffent purposes.

Below you will see
"IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)"

but what I really need is
"IF (PartWhse.OnHandQty <= PartPlant.MinimumQty)"

If I use the second line I get an error when it runs. Is there a way
to modify the file below to achieve this?

Any help is appreciated.

Dale Norris
IS Manager
Bullen Ultrasonics


***************************************************
My existing file
***************************************************\

/* BAM-PartUnderMin.p */
/* Preparred by Dale Norris 12/14/05*/
/* rev 0 - initial release */

/* Assign the include file */
{ud/GlbAlert.i & TableName = "partwhse"}

/* Define Variables*/
DEFINE VARIABLE buyername AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.
DEFINE VARIABLE buyeremail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-
UNDO.

/* Check to see if onhand qty is equal to or below min, and if
so */
/* find the name and email address of the buyerid and create an email
notificatioin */

IF (PartWhse.OnHandQty <= PartWhse.MinimumQty)
THEN DO:
FIND Part WHERE (Part.Company = PartWhse.Company) AND
(Part.PartNum = PartWhse.PartNum)
NO-LOCK.
FIND PartClass WHERE (PartClass.Company = Part.Company) AND
(PartClass.Class = Part.Class)
NO-LOCK.
FIND PurAgent WHERE (PurAgent.Company = PartClass.Company) AND
(PurAgent.BuyerID = PartClass.BuyerID)
NO-LOCK.
IF PurAgent.name <> ""
THEN DO:
buyername = STRING(PurAgent.NAME).
buyeremail = STRING(PurAgent.EMailAddress).
Assign Email-To = STRING(Puragent.EmailAddress)
Email-Subject = "Part number " + STRING
(part.partnum)
Email-Text = "~nPart Number "+ STRING
(part.partnum) + " has fallen below it's minimum quantity of " +
STRING(PartWhse.MinimumQty) + " on " + STRING(TODAY)+ " at " + STRING
(TIME,"HH:MM AM")
+ "~n"
+ "~nPlease review this Part and
initiate an order if applicable".
END.
END.
ELSE DO:
RETURN "Cancel Send":U.
END.