My global alert doesn't work (v407A)

LeAnn

below is my codes for the Requisition. follow the format and change to what is needed in your case. If you need furthur help, let me know.

{ud/GlbAlert.i &TableName = "reqhead"}
DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
FIND userfile WHERE (userfile.dcduserid = reqhead.requestorid) NO-LOCK.
FIND reqdetail WHERE (reqhead.company = reqdetail.company) AND
(reqhead.reqnum = reqdetail.reqnum) NO-LOCK NO-ERROR.
/* Create email */
ASSIGN Email-To = STRING(userfile.emailaddress)
Email-Subject = "Requisition number: " + STRING(reqhead.reqnum) + " has been submitted"
/* Create the new body of the email */
NewEmailBody = "~nRequisition number: " + STRING(reqhead.reqnum)
+ "~n~nRequested By: " + STRING(userfile.name).
ASSIGN NewEmailBody = NewEmailBody
+ "~n~nRequisition Status: Waiting For Approval!".
ASSIGN NewEmailBody = NewEmailBody
+ "~n~n-----------------------------------------------------------------------------------".
ASSIGN NewEmailBody = NewEmailBody
+ "~n~nYour requisition has been submitted and is waiting for approval."
+ "~n~nYou will get another notification once your requisition status has changed."
+ "~n~n-----------------------------------------------------------------------------------".
ASSIGN NewEmailBody = NewEmailBody
+ "~n~n----------Summary of this Requistion: -------------------".
FOR EACH reqdetail of reqhead no-lock:
Assign NewEmailBody = NewEmailBody
+ "~n~nItem " + STRING(reqdetail.reqline) + ": "
+ STRING(reqdetail.PartNum) + " " + STRING(reqdetail.LineDesc)
+ " - Qty: " + STRING(reqdetail.OrderQty)
+ "~n".
END.
ASSIGN NewEmailBody = NewEmailBody
+ "~n~nDO NOT REPLY TO THIS E-MAIL ACCOUNT, IT DOES NOT GET REVIEWED!".
/* Print Email Body */
ASSIGN Email-Text = NewEmailBody


Lam

--- In vantage@yahoogroups.com, "leann_37" <lmarruffo@...> wrote:
>
> My global alert isn't working, and I don't know why.
> Any assistance would be appreciatedÂ…
>
>
> {ud/GlbAlert.i &TableName = "RcvDtl"}
>
> DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
>
> FIND POHeader WHERE (RcvDtl.PONum = POHeader.PONum) NO-LOCK.
>
> /* Create the new body of the email */
>
> If POHeader.Termscode = "N05"
>
> THEN
>
> DO:
> ASSIGN Email-Text = "PO Number " + string(RcvDtl.PONum) + " Line Number " + RcvDtl.POLine + " Release Number " + RcvDtl.PORelNum + " has been received. Terms are net 5" + ".~n~n".
> END.
>
> ELSE DO:
> Return "CANCEL SEND":U.
> END.
>
>
> It's definitely because I am trying to read a terms code from POheader, while the BAM is assigned to RcvDetail (which doesn't have terms code), but I don't what the syntax should be to look up in one table from data read from another.
> The error is 4GL STOP condition: The Server application has returned an error. (7243) (7241)
> And references a boolean field, so it's got to be that terms codeÂ…
> This is so embarrassing...
>
> Thanks in advance!
> - leAnn
>
My global alert isn't working, and I don't know why.
Any assistance would be appreciatedÂ…


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

DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.

FIND POHeader WHERE (RcvDtl.PONum = POHeader.PONum) NO-LOCK.

/* Create the new body of the email */

If POHeader.Termscode = "N05"

THEN

DO:
ASSIGN Email-Text = "PO Number " + string(RcvDtl.PONum) + " Line Number " + RcvDtl.POLine + " Release Number " + RcvDtl.PORelNum + " has been received. Terms are net 5" + ".~n~n".
END.

ELSE DO:
Return "CANCEL SEND":U.
END.


It's definitely because I am trying to read a terms code from POheader, while the BAM is assigned to RcvDetail (which doesn't have terms code), but I don't what the syntax should be to look up in one table from data read from another.
The error is 4GL STOP condition: The Server application has returned an error. (7243) (7241)
And references a boolean field, so it's got to be that terms codeÂ…
This is so embarrassing...

Thanks in advance!
- leAnn