BAM Class 101

Michael,
Try ending your if after the not available.
and also end the else statement at the end.
I would also assign the email "to" with an email address within the .p to be
safe.
If I am not mistaken, your logic is missing the second if statement unless
the Part table is not available, the opposite of what you are looking for.
Also, I don't believe you need to call out the full name of Mfgsys.Part,
just Part should do, the database is assumed.
I suspect this will fix most of the problems.
For instance:

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

FIND Part WHERE Part.PartNum = RcvDtl.PartNum
NO-LOCK NO-ERROR.

IF NOT AVAILABLE Part THEN RETURN "Cancel Send":U.
END.

IF (Part.Mtl-AnalysisCode = "ECN":U) THEN DO:

ASSIGN Email-Subject = "ECN Critical Item"
Email-To = "insert the email address here".

END.
ELSE RETURN "Cancel Send":U.
END.

Good luck,
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: ami_miker [mailto:michael.randolph@...]
Sent: Monday, February 21, 2005 10:17 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BAM Class 101




OK folks, I need some help with my first BAM. It is simple, but I
can't get it to work. What I want is to send an alert when a part
is received that has a specific Material Analysis Code in the Part
table. The code in question is "ECN". (We are trying to improve
part of our ECN process.)

What I have written (copying from the samples) is:

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

FIND Mfgsys.Part WHERE Mfgsys.Part.PartNum = Mfgsys.RcvDtl.PartNum
NO-LOCK NO-ERROR.

IF NOT AVAILABLE Mfgsys.Part THEN RETURN "Cancel Send":U.

IF (Mfgsys.Part.Mtl-AnalysisCode = "ECN":U) THEN DO:

ASSIGN Email-Subject = "ECN Critical Item".

END.
ELSE RETURN "Cancel Send":U.

I have worked on this until I no longer get any errors, but I still
don't receive the email. Any suggestions for a Progress newbie?
Perhaps the code is OK, but I am doing something wrong on the BAM.

Thanks,
Michael Randolph
Purchasing Manager
American Magnetics, Inc.
OK folks, I need some help with my first BAM. It is simple, but I
can't get it to work. What I want is to send an alert when a part
is received that has a specific Material Analysis Code in the Part
table. The code in question is "ECN". (We are trying to improve
part of our ECN process.)

What I have written (copying from the samples) is:

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

FIND Mfgsys.Part WHERE Mfgsys.Part.PartNum = Mfgsys.RcvDtl.PartNum
NO-LOCK NO-ERROR.

IF NOT AVAILABLE Mfgsys.Part THEN RETURN "Cancel Send":U.

IF (Mfgsys.Part.Mtl-AnalysisCode = "ECN":U) THEN DO:

ASSIGN Email-Subject = "ECN Critical Item".

END.
ELSE RETURN "Cancel Send":U.

I have worked on this until I no longer get any errors, but I still
don't receive the email. Any suggestions for a Progress newbie?
Perhaps the code is OK, but I am doing something wrong on the BAM.

Thanks,
Michael Randolph
Purchasing Manager
American Magnetics, Inc.