6.1 BAM amateur - Help please

Bill,

I use the Part OnHold as a test to ensure that my process server is
still sending emails. When I get a call that alerts have stopped I
check an onhold box and send myself an email. My thinking was that
the only time I would get an email is when I checked the box, but
when a new part is created it also fires the email.

Allen

--- In vantage@yahoogroups.com, Bill Jackson <fujijapman@...> wrote:
>
> Alan,Â
>
> Thank you, I'm finally having some success, I wasn't assigning the
parameters properly in my .p program ( the parameters that the
include file require).
>
> One more question. You will only get an 'alert' based on the 'on
hold' field ( in your example), correct?Â
> Other changes to the part record will not fire this alert (?). Have
you selected only 'on hold' in the Fields List, or do you filter in
the .p program?
>
> Thanks again,
> Bill
>
>
>
>
> ________________________________
> From: apt876sp1 <atucker@...>
> To: vantage@yahoogroups.com
> Sent: Thursday, December 18, 2008 3:32:08 PM
> Subject: [Vantage] Re: 6.1 BAM amateur - Help please
>
>
> Bill,
>
> The message won't fire without the include file.
>
> I tested this one and it works.
> P file:
> ************ ********* ********* ********* ********* ***
>
> {ud/GlbAlert. i &TableName = "Part"}
>
> MESSAGE "This is a warning box!" VIEW-AS ALERT-BOX WARNING BUTTONS
OK.
>
> ************ ********* ********* ********* ********* ***
>
> I'm watching the Part Table and only the OnHold field. Then I can
> test by selecting any part and changing the On Hold checkbox. ( a
> function we don't use)
>
> On the BAM be sure Create Log and Send Alert are checked and be
sure
> to point to the p file in the Alert Program fillin.
>
> Allen
>
> --- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...>
wrote:
> >
> > Thanks  Alan,
> >
> > Â I can fix that, but I can't even get a simple 'message.p'
program
> to run off of a BAM, a program with no reference to the 'include'
file
> (just trying to display a message, for starters).
> >
> >
> >
> >
> > ____________ _________ _________ __
> > From: apt876sp1 <atucker@ >
> > To: vantage@yahoogroups .com
> > Sent: Wednesday, December 17, 2008 4:01:11 PM
> > Subject: [Vantage] Re: 6.1 BAM amateur - Help please
> >
> >
> > Try changing your condition line to: <If NOT (orderhed.checkbox0
2)
> > THEN DO:> It appears there is a space in the fieldname.
> >
> > Allen
> >
> > --- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...>
> wrote:
> > >
> > > Trying to get a .p program to run in a 'BAM'Â (version
6.10.541)
> (
> > Date Changed on a PO Release , send email with data ).
> > >
> > > (Fields selected are DueDate, PONum)
> > >
> > > I think the problem is with the 'include' file (GlbAlert.i) ,
> > follows:
> > >
> > > /*********** ********* ********* ********* ********* *********
> ********* **
> > ************ ********
> > > Â Â Â Name: ud\GlbAlert. i
> > > Â Â Â
> > > Â Â Â User Defined Global Alerts Include File
> > > Â Â Â
> > > Â Â Â This include file contains the parameters used for a User
> > Defined global alert program.
> > > Â Â Â These programs can access the record being changed through
> the
> > buffers passed to
> > > Â Â Â the procedure by global alerts.
> > > Â Â Â
> > > Â Â Â Usage:
> > > Â Â Â Include at the beginning of the User Defined Global Alert
> > Program and indicate
> > >    the record being passed to the procedure. Such as:
> > > Â Â Â
> > > Â Â Â {ud/GlbAlert. i &TableName = "Customer"}
> > > Â Â Â
> > > Â Â Â
> > > Â Â Â Include Parameters:
> > > Â Â Â ------------ -------
> > >    &TableName         (Required) The name of the DB table
> > > Â Â Â
> > > Â Â Â
> > > Â Â Â Record Parameters:
> > > Â Â Â ------------ -------
> > > Â Â Â OLD<tablename>Â Â Â Â Â The old values of the DB record being
> > changed
> > > Â Â Â <tablename>Â Â Â Â Â Â Â Â The new values of the DB record being
> > changed
> > > Â Â Â ChgLogGAÂ Â Â Â Â Â Â Â Â Â Â The record of the Change Log being
> processed
> > > Â Â Â
> > > Â Â Â Email Parameters:
> > > Â Â Â ------------ -----
> > >    Email-From         The email address from which the email
> will
> > be sent
> > >    Email-To           The a semi-colon delimited list of
email
> > addresses
> > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be sent
> > > Â Â Â Email-CCÂ Â Â Â Â Â Â Â Â Â Â The a semi-colon delimited list of
email
> > addresses
> > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be carbon-copied
> > >    Email-Subject      The subject line of the email
> > >    Email-Text         The body of the email
> > >    Email-Mime-Header  The type of email being sent. The
> > preprocessors
> > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {&TEXT-Mime} and {&HTML-Mime} can be
used
> > to switch
> > > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â between text and html emails.
> > >    Email-BodyType     This should always be "text".
> > >    SendEmail          (default TRUE) Setting this to FALSE
will
> > cancel the send of the email
> > > Â Â Â
> > > Â Â Â Return Values:
> > > Â Â Â ------------ --
> > > Â Â Â "Cancel Send"Â Â Â Â Â Â Cancels the send of the e-mail.
> > > Â Â Â
> > > Â Â Â
> > > Â Â Â History:
> > >    01/12/04 Bab scr7716 - Qualify database references with
the
> > mfgsys database
> > >
> > ************ ********* ********* ********* ********* *********
> ********* ****
> > ************ *******/
> > > DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.
{&TableName} .
> > > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > > DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
> > > DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
> > > DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
> > > &GLOBAL-DEFINE HTML-Mime "type=text/html: charset=us-
> > ascii:filetype= ascii":U
> > > &GLOBAL-DEFINE TEXT-Mime "type=text/text: charset=us-
> > ascii:filetype= ascii":U
> > >
> > > ************ ********* ********* ********* ********* *********
> ********* **
> > >
> > > I started with just a 'message' .p program to verify that my
> > program is compatible with the '.i' file.
> > >
> > > I have written quite a few programs in 4GL (simple .p follows -
> > bulk of which is commented out) :
> > >
> > > ************ ********* ********* ********* ********* **
> > >
> > >
> > > {V:\mfgsys61\ ud/GlbAlert. i &TableName = "PORel"}
> > > DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
> > > MESSAGE "changed.." VIEW-AS ALERT-BOX.
> > > Â Â Â Â Â Â Â Â Â Â Â Â Â /*********** ********* ********* /
> > > /* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
> > > (Customer.CustNum = OrderHed.CustNum)
> > > NO-LOCK.
> > > FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
> > > (OrderDtl.Ordernum = Orderhed.OrderNum)
> > > NO-LOCK NO-ERROR.
> > > /*Dont send email if "SEND EMAIL" checkbox is not checked */
> > > If NOT (orderhed.checkbox0 2) THEN DO:
> > > RETURN "CANCEL SEND":U.
> > > END.
> > > /* Create email */
> > > ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab
> > s.com"
> > > Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
> > > /* Create the new body of the email */
> > > NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
> > > + "~n~nCustomer: " + STRING(Customer. Name)
> > > + "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
> > > THEN "see below" ELSE STRING(orderhed. RequestDate) )
> > > + "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
> > > + "~n~nOrder Lines:~n".
> > > /* Lines of Order */
> > > FOR EACH OrderDtl of OrderHed no-lock:
> > > Assign NewEmailBody = NewEmailBody
> > > + " Item " + STRING(OrderDtl. OrderLine) + ": " +
> > > STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
> > > + (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
> > > STRING(OrderDtl. RequestDate) ELSE "")
> > > + "~n".
> > > END.
> > > ASSIGN NewEmailBody = NewEmailBody
> > > + "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
> > > + "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
> > > NOT GET REVIEW!".
> > > /* Print Email Body */
> > > ASSIGN Email-Text = NewEmailBody  */
> > >
> > > ************ ********* ********* ********* ********* *****
> > >
> > >
> > >
> > > Â
> > >
> > >
> > >
> > > ____________ _________ _________ __
> > > From: Stuart Noble <stuart@>
> > > To: vantage@yahoogroups .com
> > > Sent: Thursday, March 22, 2007 12:13:29 AM
> > > Subject: [Vantage] 6.1 BAM amateur - Help please
> > >
> > >
> > > Two problems.
> > >
> > > I am trying to get a message to pop up when an Accounts
Receivable
> > > Invoice is automatically generated for a past fiscal period,
and
> I
> > want
> > > it to prompt the person to change the invoice header before it
is
> > posted
> > > to a closed period.
> > >
> > > Problem 1: I have it triggering off InvcHead.InvoiceNum , but I
> > don't
> > > even get an email when an invoice is generated after a get
> > shipment. Is
> > > there a better field to trigger from? I need to at least
trigger
> an
> > > alert before my BAM will work, which it isn't yet! See problem
2!
> > >
> > > Problem 2:Can anyone see the problem in the following .p for a
> BAM.
> > When
> > > I debug, I get an error about "mismatched number of parameters
> > passed to
> > > procedure."
> > >
> > > {ud/GlbAlert. i &TableName = "InvcHead"}
> > >
> > > Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-
lock.
> > >
> > > IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:
> > >
> > > Message "This Invoice Will be Posted to the WRONG FISCAL
PERIOD.
> > Please
> > > correct before continuing!"
> > >
> > > View-as alert-box information buttons ok.
> > >
> > > END.
> > >
> > > Return "Cancel Send":U.
> > >
> > > Return.
> > >
> > > Thanks in advance for any assistance
> > >
> > > Stuart Noble
> > > Thompson Meat Machinery
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Two problems.

I am trying to get a message to pop up when an Accounts Receivable
Invoice is automatically generated for a past fiscal period, and I want
it to prompt the person to change the invoice header before it is posted
to a closed period.



Problem 1: I have it triggering off InvcHead.InvoiceNum, but I don't
even get an email when an invoice is generated after a get shipment. Is
there a better field to trigger from? I need to at least trigger an
alert before my BAM will work, which it isn't yet! See problem 2!





Problem 2:Can anyone see the problem in the following .p for a BAM. When
I debug, I get an error about "mismatched number of parameters passed to
procedure."







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



Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.



IF Invchead.FiscalPeriod < GLSyst.CurrentFiscalPeriod THEN DO:



Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD. Please
correct before continuing!"



View-as alert-box information buttons ok.



END.



Return "Cancel Send":U.



Return.



Thanks in advance for any assistance



Stuart Noble
Thompson Meat Machinery






[Non-text portions of this message have been removed]
Trying to get a .p program to run in a 'BAM'Â (version 6.10.541) ( Date Changed on a PO Release , send email with data ).

(Fields selected are DueDate, PONum)

I think the problem is with the 'include' file (GlbAlert.i), follows:

/***************************************************************************************
   Name: ud\GlbAlert.i
  Â
   User Defined Global Alerts Include File
  Â
   This include file contains the parameters used for a User Defined global alert program.
   These programs can access the record being changed through the buffers passed to
   the procedure by global alerts.
  Â
   Usage:
   Include at the beginning of the User Defined Global Alert Program and indicate
   the record being passed to the procedure. Such as:
  Â
   {ud/GlbAlert.i &TableName = "Customer"}
  Â
  Â
   Include Parameters:
   -------------------
   &TableName         (Required) The name of the DB table
  Â
  Â
   Record Parameters:
   -------------------
   OLD<tablename>     The old values of the DB record being changed
   <tablename>        The new values of the DB record being changed
   ChgLogGA           The record of the Change Log being processed
  Â
   Email Parameters:
   -----------------
   Email-From         The email address from which the email will be sent
   Email-To           The a semi-colon delimited list of email addresses
                       to which the email will be sent
   Email-CC           The a semi-colon delimited list of email addresses
                       to which the email will be carbon-copied
   Email-Subject      The subject line of the email
   Email-Text         The body of the email
   Email-Mime-Header  The type of email being sent. The preprocessors
                       {&TEXT-Mime} and {&HTML-Mime} can be used to switch
                       between text and html emails.
   Email-BodyType     This should always be "text".
   SendEmail          (default TRUE) Setting this to FALSE will cancel the send of the email
  Â
   Return Values:
   --------------
   "Cancel Send"      Cancels the send of the e-mail.
  Â
  Â
   History:
   01/12/04 Bab scr7716 - Qualify database references with the mfgsys database
*****************************************************************************************/
DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.{&TableName}.
DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName}.
DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName}.
DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
&GLOBAL-DEFINE HTML-Mime "type=text/html:charset=us-ascii:filetype=ascii":U
&GLOBAL-DEFINE TEXT-Mime "type=text/text:charset=us-ascii:filetype=ascii":U

********************************************************************

I started with just a 'message' .p program to verify that my program is compatible with the '.i' file.

I have written quite a few programs in 4GL (simple .p follows - bulk of which is commented out) :

**************************************************


{V:\mfgsys61\ud/GlbAlert.i &TableName = "PORel"}
DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
MESSAGE "changed.." VIEW-AS ALERT-BOX.
             /*****************************/
/* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
(Customer.CustNum = OrderHed.CustNum)
NO-LOCK.
FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
(OrderDtl.Ordernum = Orderhed.OrderNum)
NO-LOCK NO-ERROR.
/*Dont send email if "SEND EMAIL" checkbox is not checked */
If NOT (orderhed.checkbox0 2) THEN DO:
RETURN "CANCEL SEND":U.
END.
/* Create email */
ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab s.com"
Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
/* Create the new body of the email */
NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
+ "~n~nCustomer: " + STRING(Customer. Name)
+ "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
THEN "see below" ELSE STRING(orderhed. RequestDate) )
+ "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
+ "~n~nOrder Lines:~n".
/* Lines of Order */
FOR EACH OrderDtl of OrderHed no-lock:
Assign NewEmailBody = NewEmailBody
+ " Item " + STRING(OrderDtl. OrderLine) + ": " +
STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
+ (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
STRING(OrderDtl. RequestDate) ELSE "")
+ "~n".
END.
ASSIGN NewEmailBody = NewEmailBody
+ "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
+ "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
NOT GET REVIEW!".
/* Print Email Body */
ASSIGN Email-Text = NewEmailBody  */

*****************************************************



Â



________________________________
From: Stuart Noble <stuart@...>
To: vantage@yahoogroups.com
Sent: Thursday, March 22, 2007 12:13:29 AM
Subject: [Vantage] 6.1 BAM amateur - Help please


Two problems.

I am trying to get a message to pop up when an Accounts Receivable
Invoice is automatically generated for a past fiscal period, and I want
it to prompt the person to change the invoice header before it is posted
to a closed period.

Problem 1: I have it triggering off InvcHead.InvoiceNum , but I don't
even get an email when an invoice is generated after a get shipment. Is
there a better field to trigger from? I need to at least trigger an
alert before my BAM will work, which it isn't yet! See problem 2!

Problem 2:Can anyone see the problem in the following .p for a BAM. When
I debug, I get an error about "mismatched number of parameters passed to
procedure."

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

Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.

IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:

Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD. Please
correct before continuing!"

View-as alert-box information buttons ok.

END.

Return "Cancel Send":U.

Return.

Thanks in advance for any assistance

Stuart Noble
Thompson Meat Machinery


[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
Try changing your condition line to: <If NOT (orderhed.checkbox02)
THEN DO:> It appears there is a space in the fieldname.

Allen

--- In vantage@yahoogroups.com, Bill Jackson <fujijapman@...> wrote:
>
> Trying to get a .p program to run in a 'BAM'Â (version 6.10.541) (
Date Changed on a PO Release , send email with data ).
>
> (Fields selected are DueDate, PONum)
>
> I think the problem is with the 'include' file (GlbAlert.i),
follows:
>
> /*******************************************************************
********************
> Â Â Â Name: ud\GlbAlert.i
> Â Â Â
> Â Â Â User Defined Global Alerts Include File
> Â Â Â
> Â Â Â This include file contains the parameters used for a User
Defined global alert program.
> Â Â Â These programs can access the record being changed through the
buffers passed to
> Â Â Â the procedure by global alerts.
> Â Â Â
> Â Â Â Usage:
> Â Â Â Include at the beginning of the User Defined Global Alert
Program and indicate
>    the record being passed to the procedure. Such as:
> Â Â Â
> Â Â Â {ud/GlbAlert.i &TableName = "Customer"}
> Â Â Â
> Â Â Â
> Â Â Â Include Parameters:
> Â Â Â -------------------
>    &TableName         (Required) The name of the DB table
> Â Â Â
> Â Â Â
> Â Â Â Record Parameters:
> Â Â Â -------------------
> Â Â Â OLD<tablename>Â Â Â Â Â The old values of the DB record being
changed
> Â Â Â <tablename>Â Â Â Â Â Â Â Â The new values of the DB record being
changed
> Â Â Â ChgLogGAÂ Â Â Â Â Â Â Â Â Â Â The record of the Change Log being processed
> Â Â Â
> Â Â Â Email Parameters:
> Â Â Â -----------------
>    Email-From         The email address from which the email will
be sent
>    Email-To           The a semi-colon delimited list of email
addresses
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be sent
> Â Â Â Email-CCÂ Â Â Â Â Â Â Â Â Â Â The a semi-colon delimited list of email
addresses
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be carbon-copied
>    Email-Subject      The subject line of the email
>    Email-Text         The body of the email
>    Email-Mime-Header  The type of email being sent. The
preprocessors
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {&TEXT-Mime} and {&HTML-Mime} can be used
to switch
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â between text and html emails.
>    Email-BodyType     This should always be "text".
>    SendEmail          (default TRUE) Setting this to FALSE will
cancel the send of the email
> Â Â Â
> Â Â Â Return Values:
> Â Â Â --------------
> Â Â Â "Cancel Send"Â Â Â Â Â Â Cancels the send of the e-mail.
> Â Â Â
> Â Â Â
> Â Â Â History:
>    01/12/04 Bab scr7716 - Qualify database references with the
mfgsys database
>
**********************************************************************
*******************/
> DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.{&TableName}.
> DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName}.
> DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName}.
> DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
> DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
> DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
> &GLOBAL-DEFINE HTML-Mime "type=text/html:charset=us-
ascii:filetype=ascii":U
> &GLOBAL-DEFINE TEXT-Mime "type=text/text:charset=us-
ascii:filetype=ascii":U
>
> ********************************************************************
>
> I started with just a 'message' .p program to verify that my
program is compatible with the '.i' file.
>
> I have written quite a few programs in 4GL (simple .p follows -
bulk of which is commented out) :
>
> **************************************************
>
>
> {V:\mfgsys61\ud/GlbAlert.i &TableName = "PORel"}
> DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
> MESSAGE "changed.." VIEW-AS ALERT-BOX.
> Â Â Â Â Â Â Â Â Â Â Â Â Â /*****************************/
> /* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
> (Customer.CustNum = OrderHed.CustNum)
> NO-LOCK.
> FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
> (OrderDtl.Ordernum = Orderhed.OrderNum)
> NO-LOCK NO-ERROR.
> /*Dont send email if "SEND EMAIL" checkbox is not checked */
> If NOT (orderhed.checkbox0 2) THEN DO:
> RETURN "CANCEL SEND":U.
> END.
> /* Create email */
> ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab
s.com"
> Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
> /* Create the new body of the email */
> NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
> + "~n~nCustomer: " + STRING(Customer. Name)
> + "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
> THEN "see below" ELSE STRING(orderhed. RequestDate) )
> + "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
> + "~n~nOrder Lines:~n".
> /* Lines of Order */
> FOR EACH OrderDtl of OrderHed no-lock:
> Assign NewEmailBody = NewEmailBody
> + " Item " + STRING(OrderDtl. OrderLine) + ": " +
> STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
> + (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
> STRING(OrderDtl. RequestDate) ELSE "")
> + "~n".
> END.
> ASSIGN NewEmailBody = NewEmailBody
> + "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
> + "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
> NOT GET REVIEW!".
> /* Print Email Body */
> ASSIGN Email-Text = NewEmailBody  */
>
> *****************************************************
>
>
>
> Â
>
>
>
> ________________________________
> From: Stuart Noble <stuart@...>
> To: vantage@yahoogroups.com
> Sent: Thursday, March 22, 2007 12:13:29 AM
> Subject: [Vantage] 6.1 BAM amateur - Help please
>
>
> Two problems.
>
> I am trying to get a message to pop up when an Accounts Receivable
> Invoice is automatically generated for a past fiscal period, and I
want
> it to prompt the person to change the invoice header before it is
posted
> to a closed period.
>
> Problem 1: I have it triggering off InvcHead.InvoiceNum , but I
don't
> even get an email when an invoice is generated after a get
shipment. Is
> there a better field to trigger from? I need to at least trigger an
> alert before my BAM will work, which it isn't yet! See problem 2!
>
> Problem 2:Can anyone see the problem in the following .p for a BAM.
When
> I debug, I get an error about "mismatched number of parameters
passed to
> procedure."
>
> {ud/GlbAlert. i &TableName = "InvcHead"}
>
> Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.
>
> IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:
>
> Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD.
Please
> correct before continuing!"
>
> View-as alert-box information buttons ok.
>
> END.
>
> Return "Cancel Send":U.
>
> Return.
>
> Thanks in advance for any assistance
>
> Stuart Noble
> Thompson Meat Machinery
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Thanks  Alan,

 I can fix that, but I can't even get a simple 'message.p' program to run off of a BAM, a program with no reference to the 'include' file(just trying to display a message, for starters).




________________________________
From: apt876sp1 <atucker@...>
To: vantage@yahoogroups.com
Sent: Wednesday, December 17, 2008 4:01:11 PM
Subject: [Vantage] Re: 6.1 BAM amateur - Help please


Try changing your condition line to: <If NOT (orderhed.checkbox0 2)
THEN DO:> It appears there is a space in the fieldname.

Allen

--- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...> wrote:
>
> Trying to get a .p program to run in a 'BAM'Â (version 6.10.541) (
Date Changed on a PO Release , send email with data ).
>
> (Fields selected are DueDate, PONum)
>
> I think the problem is with the 'include' file (GlbAlert.i) ,
follows:
>
> /*********** ********* ********* ********* ********* ********* ********* **
************ ********
> Â Â Â Name: ud\GlbAlert. i
> Â Â Â
> Â Â Â User Defined Global Alerts Include File
> Â Â Â
> Â Â Â This include file contains the parameters used for a User
Defined global alert program.
> Â Â Â These programs can access the record being changed through the
buffers passed to
> Â Â Â the procedure by global alerts.
> Â Â Â
> Â Â Â Usage:
> Â Â Â Include at the beginning of the User Defined Global Alert
Program and indicate
>    the record being passed to the procedure. Such as:
> Â Â Â
> Â Â Â {ud/GlbAlert. i &TableName = "Customer"}
> Â Â Â
> Â Â Â
> Â Â Â Include Parameters:
> Â Â Â ------------ -------
>    &TableName         (Required) The name of the DB table
> Â Â Â
> Â Â Â
> Â Â Â Record Parameters:
> Â Â Â ------------ -------
> Â Â Â OLD<tablename>Â Â Â Â Â The old values of the DB record being
changed
> Â Â Â <tablename>Â Â Â Â Â Â Â Â The new values of the DB record being
changed
> Â Â Â ChgLogGAÂ Â Â Â Â Â Â Â Â Â Â The record of the Change Log being processed
> Â Â Â
> Â Â Â Email Parameters:
> Â Â Â ------------ -----
>    Email-From         The email address from which the email will
be sent
>    Email-To           The a semi-colon delimited list of email
addresses
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be sent
> Â Â Â Email-CCÂ Â Â Â Â Â Â Â Â Â Â The a semi-colon delimited list of email
addresses
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be carbon-copied
>    Email-Subject      The subject line of the email
>    Email-Text         The body of the email
>    Email-Mime-Header  The type of email being sent. The
preprocessors
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {&TEXT-Mime} and {&HTML-Mime} can be used
to switch
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â between text and html emails.
>    Email-BodyType     This should always be "text".
>    SendEmail          (default TRUE) Setting this to FALSE will
cancel the send of the email
> Â Â Â
> Â Â Â Return Values:
> Â Â Â ------------ --
> Â Â Â "Cancel Send"Â Â Â Â Â Â Cancels the send of the e-mail.
> Â Â Â
> Â Â Â
> Â Â Â History:
>    01/12/04 Bab scr7716 - Qualify database references with the
mfgsys database
>
************ ********* ********* ********* ********* ********* ********* ****
************ *******/
> DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.{&TableName} .
> DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
> DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
> DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
> DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
> &GLOBAL-DEFINE HTML-Mime "type=text/html: charset=us-
ascii:filetype= ascii":U
> &GLOBAL-DEFINE TEXT-Mime "type=text/text: charset=us-
ascii:filetype= ascii":U
>
> ************ ********* ********* ********* ********* ********* ********* **
>
> I started with just a 'message' .p program to verify that my
program is compatible with the '.i' file.
>
> I have written quite a few programs in 4GL (simple .p follows -
bulk of which is commented out) :
>
> ************ ********* ********* ********* ********* **
>
>
> {V:\mfgsys61\ ud/GlbAlert. i &TableName = "PORel"}
> DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
> MESSAGE "changed.." VIEW-AS ALERT-BOX.
> Â Â Â Â Â Â Â Â Â Â Â Â Â /*********** ********* ********* /
> /* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
> (Customer.CustNum = OrderHed.CustNum)
> NO-LOCK.
> FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
> (OrderDtl.Ordernum = Orderhed.OrderNum)
> NO-LOCK NO-ERROR.
> /*Dont send email if "SEND EMAIL" checkbox is not checked */
> If NOT (orderhed.checkbox0 2) THEN DO:
> RETURN "CANCEL SEND":U.
> END.
> /* Create email */
> ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab
s.com"
> Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
> /* Create the new body of the email */
> NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
> + "~n~nCustomer: " + STRING(Customer. Name)
> + "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
> THEN "see below" ELSE STRING(orderhed. RequestDate) )
> + "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
> + "~n~nOrder Lines:~n".
> /* Lines of Order */
> FOR EACH OrderDtl of OrderHed no-lock:
> Assign NewEmailBody = NewEmailBody
> + " Item " + STRING(OrderDtl. OrderLine) + ": " +
> STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
> + (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
> STRING(OrderDtl. RequestDate) ELSE "")
> + "~n".
> END.
> ASSIGN NewEmailBody = NewEmailBody
> + "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
> + "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
> NOT GET REVIEW!".
> /* Print Email Body */
> ASSIGN Email-Text = NewEmailBody  */
>
> ************ ********* ********* ********* ********* *****
>
>
>
> Â
>
>
>
> ____________ _________ _________ __
> From: Stuart Noble <stuart@...>
> To: vantage@yahoogroups .com
> Sent: Thursday, March 22, 2007 12:13:29 AM
> Subject: [Vantage] 6.1 BAM amateur - Help please
>
>
> Two problems.
>
> I am trying to get a message to pop up when an Accounts Receivable
> Invoice is automatically generated for a past fiscal period, and I
want
> it to prompt the person to change the invoice header before it is
posted
> to a closed period.
>
> Problem 1: I have it triggering off InvcHead.InvoiceNum , but I
don't
> even get an email when an invoice is generated after a get
shipment. Is
> there a better field to trigger from? I need to at least trigger an
> alert before my BAM will work, which it isn't yet! See problem 2!
>
> Problem 2:Can anyone see the problem in the following .p for a BAM.
When
> I debug, I get an error about "mismatched number of parameters
passed to
> procedure."
>
> {ud/GlbAlert. i &TableName = "InvcHead"}
>
> Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.
>
> IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:
>
> Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD.
Please
> correct before continuing!"
>
> View-as alert-box information buttons ok.
>
> END.
>
> Return "Cancel Send":U.
>
> Return.
>
> Thanks in advance for any assistance
>
> Stuart Noble
> Thompson Meat Machinery
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
Bill,

The message won't fire without the include file.

I tested this one and it works.
P file:
***************************************************

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

MESSAGE "This is a warning box!" VIEW-AS ALERT-BOX WARNING BUTTONS OK.


***************************************************

I'm watching the Part Table and only the OnHold field. Then I can
test by selecting any part and changing the On Hold checkbox. ( a
function we don't use)

On the BAM be sure Create Log and Send Alert are checked and be sure
to point to the p file in the Alert Program fillin.

Allen



--- In vantage@yahoogroups.com, Bill Jackson <fujijapman@...> wrote:
>
> Thanks  Alan,
>
> Â I can fix that, but I can't even get a simple 'message.p' program
to run off of a BAM, a program with no reference to the 'include' file
(just trying to display a message, for starters).
>
>
>
>
> ________________________________
> From: apt876sp1 <atucker@...>
> To: vantage@yahoogroups.com
> Sent: Wednesday, December 17, 2008 4:01:11 PM
> Subject: [Vantage] Re: 6.1 BAM amateur - Help please
>
>
> Try changing your condition line to: <If NOT (orderhed.checkbox0 2)
> THEN DO:> It appears there is a space in the fieldname.
>
> Allen
>
> --- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...>
wrote:
> >
> > Trying to get a .p program to run in a 'BAM'Â (version 6.10.541)
(
> Date Changed on a PO Release , send email with data ).
> >
> > (Fields selected are DueDate, PONum)
> >
> > I think the problem is with the 'include' file (GlbAlert.i) ,
> follows:
> >
> > /*********** ********* ********* ********* ********* *********
********* **
> ************ ********
> > Â Â Â Name: ud\GlbAlert. i
> > Â Â Â
> > Â Â Â User Defined Global Alerts Include File
> > Â Â Â
> > Â Â Â This include file contains the parameters used for a User
> Defined global alert program.
> > Â Â Â These programs can access the record being changed through
the
> buffers passed to
> > Â Â Â the procedure by global alerts.
> > Â Â Â
> > Â Â Â Usage:
> > Â Â Â Include at the beginning of the User Defined Global Alert
> Program and indicate
> >    the record being passed to the procedure. Such as:
> > Â Â Â
> > Â Â Â {ud/GlbAlert. i &TableName = "Customer"}
> > Â Â Â
> > Â Â Â
> > Â Â Â Include Parameters:
> > Â Â Â ------------ -------
> >    &TableName         (Required) The name of the DB table
> > Â Â Â
> > Â Â Â
> > Â Â Â Record Parameters:
> > Â Â Â ------------ -------
> > Â Â Â OLD<tablename>Â Â Â Â Â The old values of the DB record being
> changed
> > Â Â Â <tablename>Â Â Â Â Â Â Â Â The new values of the DB record being
> changed
> > Â Â Â ChgLogGAÂ Â Â Â Â Â Â Â Â Â Â The record of the Change Log being
processed
> > Â Â Â
> > Â Â Â Email Parameters:
> > Â Â Â ------------ -----
> >    Email-From         The email address from which the email
will
> be sent
> >    Email-To           The a semi-colon delimited list of email
> addresses
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be sent
> > Â Â Â Email-CCÂ Â Â Â Â Â Â Â Â Â Â The a semi-colon delimited list of email
> addresses
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be carbon-copied
> >    Email-Subject      The subject line of the email
> >    Email-Text         The body of the email
> >    Email-Mime-Header  The type of email being sent. The
> preprocessors
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {&TEXT-Mime} and {&HTML-Mime} can be used
> to switch
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â between text and html emails.
> >    Email-BodyType     This should always be "text".
> >    SendEmail          (default TRUE) Setting this to FALSE will
> cancel the send of the email
> > Â Â Â
> > Â Â Â Return Values:
> > Â Â Â ------------ --
> > Â Â Â "Cancel Send"Â Â Â Â Â Â Cancels the send of the e-mail.
> > Â Â Â
> > Â Â Â
> > Â Â Â History:
> >    01/12/04 Bab scr7716 - Qualify database references with the
> mfgsys database
> >
> ************ ********* ********* ********* ********* *********
********* ****
> ************ *******/
> > DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
> > DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
> > DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
> > &GLOBAL-DEFINE HTML-Mime "type=text/html: charset=us-
> ascii:filetype= ascii":U
> > &GLOBAL-DEFINE TEXT-Mime "type=text/text: charset=us-
> ascii:filetype= ascii":U
> >
> > ************ ********* ********* ********* ********* *********
********* **
> >
> > I started with just a 'message' .p program to verify that my
> program is compatible with the '.i' file.
> >
> > I have written quite a few programs in 4GL (simple .p follows -
> bulk of which is commented out) :
> >
> > ************ ********* ********* ********* ********* **
> >
> >
> > {V:\mfgsys61\ ud/GlbAlert. i &TableName = "PORel"}
> > DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
> > MESSAGE "changed.." VIEW-AS ALERT-BOX.
> > Â Â Â Â Â Â Â Â Â Â Â Â Â /*********** ********* ********* /
> > /* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
> > (Customer.CustNum = OrderHed.CustNum)
> > NO-LOCK.
> > FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
> > (OrderDtl.Ordernum = Orderhed.OrderNum)
> > NO-LOCK NO-ERROR.
> > /*Dont send email if "SEND EMAIL" checkbox is not checked */
> > If NOT (orderhed.checkbox0 2) THEN DO:
> > RETURN "CANCEL SEND":U.
> > END.
> > /* Create email */
> > ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab
> s.com"
> > Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
> > /* Create the new body of the email */
> > NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
> > + "~n~nCustomer: " + STRING(Customer. Name)
> > + "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
> > THEN "see below" ELSE STRING(orderhed. RequestDate) )
> > + "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
> > + "~n~nOrder Lines:~n".
> > /* Lines of Order */
> > FOR EACH OrderDtl of OrderHed no-lock:
> > Assign NewEmailBody = NewEmailBody
> > + " Item " + STRING(OrderDtl. OrderLine) + ": " +
> > STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
> > + (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
> > STRING(OrderDtl. RequestDate) ELSE "")
> > + "~n".
> > END.
> > ASSIGN NewEmailBody = NewEmailBody
> > + "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
> > + "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
> > NOT GET REVIEW!".
> > /* Print Email Body */
> > ASSIGN Email-Text = NewEmailBody  */
> >
> > ************ ********* ********* ********* ********* *****
> >
> >
> >
> > Â
> >
> >
> >
> > ____________ _________ _________ __
> > From: Stuart Noble <stuart@>
> > To: vantage@yahoogroups .com
> > Sent: Thursday, March 22, 2007 12:13:29 AM
> > Subject: [Vantage] 6.1 BAM amateur - Help please
> >
> >
> > Two problems.
> >
> > I am trying to get a message to pop up when an Accounts Receivable
> > Invoice is automatically generated for a past fiscal period, and
I
> want
> > it to prompt the person to change the invoice header before it is
> posted
> > to a closed period.
> >
> > Problem 1: I have it triggering off InvcHead.InvoiceNum , but I
> don't
> > even get an email when an invoice is generated after a get
> shipment. Is
> > there a better field to trigger from? I need to at least trigger
an
> > alert before my BAM will work, which it isn't yet! See problem 2!
> >
> > Problem 2:Can anyone see the problem in the following .p for a
BAM.
> When
> > I debug, I get an error about "mismatched number of parameters
> passed to
> > procedure."
> >
> > {ud/GlbAlert. i &TableName = "InvcHead"}
> >
> > Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.
> >
> > IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:
> >
> > Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD.
> Please
> > correct before continuing!"
> >
> > View-as alert-box information buttons ok.
> >
> > END.
> >
> > Return "Cancel Send":U.
> >
> > Return.
> >
> > Thanks in advance for any assistance
> >
> > Stuart Noble
> > Thompson Meat Machinery
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Alan,Â

Thank you, I'm finally having some success, I wasn't assigning the parameters properly in my .p program ( the parameters that the include file require).

One more question. You will only get an 'alert' based on the 'on hold' field ( in your example), correct?Â
Other changes to the part record will not fire this alert (?). Have you selected only 'on hold' in the Fields List, or do you filter in the .p program?

Thanks again,
Bill




________________________________
From: apt876sp1 <atucker@...>
To: vantage@yahoogroups.com
Sent: Thursday, December 18, 2008 3:32:08 PM
Subject: [Vantage] Re: 6.1 BAM amateur - Help please


Bill,

The message won't fire without the include file.

I tested this one and it works.
P file:
************ ********* ********* ********* ********* ***

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

MESSAGE "This is a warning box!" VIEW-AS ALERT-BOX WARNING BUTTONS OK.

************ ********* ********* ********* ********* ***

I'm watching the Part Table and only the OnHold field. Then I can
test by selecting any part and changing the On Hold checkbox. ( a
function we don't use)

On the BAM be sure Create Log and Send Alert are checked and be sure
to point to the p file in the Alert Program fillin.

Allen

--- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...> wrote:
>
> Thanks  Alan,
>
> Â I can fix that, but I can't even get a simple 'message.p' program
to run off of a BAM, a program with no reference to the 'include' file
(just trying to display a message, for starters).
>
>
>
>
> ____________ _________ _________ __
> From: apt876sp1 <atucker@... >
> To: vantage@yahoogroups .com
> Sent: Wednesday, December 17, 2008 4:01:11 PM
> Subject: [Vantage] Re: 6.1 BAM amateur - Help please
>
>
> Try changing your condition line to: <If NOT (orderhed.checkbox0 2)
> THEN DO:> It appears there is a space in the fieldname.
>
> Allen
>
> --- In vantage@yahoogroups .com, Bill Jackson <fujijapman@ ...>
wrote:
> >
> > Trying to get a .p program to run in a 'BAM'Â (version 6.10.541)
(
> Date Changed on a PO Release , send email with data ).
> >
> > (Fields selected are DueDate, PONum)
> >
> > I think the problem is with the 'include' file (GlbAlert.i) ,
> follows:
> >
> > /*********** ********* ********* ********* ********* *********
********* **
> ************ ********
> > Â Â Â Name: ud\GlbAlert. i
> > Â Â Â
> > Â Â Â User Defined Global Alerts Include File
> > Â Â Â
> > Â Â Â This include file contains the parameters used for a User
> Defined global alert program.
> > Â Â Â These programs can access the record being changed through
the
> buffers passed to
> > Â Â Â the procedure by global alerts.
> > Â Â Â
> > Â Â Â Usage:
> > Â Â Â Include at the beginning of the User Defined Global Alert
> Program and indicate
> >    the record being passed to the procedure. Such as:
> > Â Â Â
> > Â Â Â {ud/GlbAlert. i &TableName = "Customer"}
> > Â Â Â
> > Â Â Â
> > Â Â Â Include Parameters:
> > Â Â Â ------------ -------
> >    &TableName         (Required) The name of the DB table
> > Â Â Â
> > Â Â Â
> > Â Â Â Record Parameters:
> > Â Â Â ------------ -------
> > Â Â Â OLD<tablename>Â Â Â Â Â The old values of the DB record being
> changed
> > Â Â Â <tablename>Â Â Â Â Â Â Â Â The new values of the DB record being
> changed
> > Â Â Â ChgLogGAÂ Â Â Â Â Â Â Â Â Â Â The record of the Change Log being
processed
> > Â Â Â
> > Â Â Â Email Parameters:
> > Â Â Â ------------ -----
> >    Email-From         The email address from which the email
will
> be sent
> >    Email-To           The a semi-colon delimited list of email
> addresses
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be sent
> > Â Â Â Email-CCÂ Â Â Â Â Â Â Â Â Â Â The a semi-colon delimited list of email
> addresses
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â to which the email will be carbon-copied
> >    Email-Subject      The subject line of the email
> >    Email-Text         The body of the email
> >    Email-Mime-Header  The type of email being sent. The
> preprocessors
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {&TEXT-Mime} and {&HTML-Mime} can be used
> to switch
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â between text and html emails.
> >    Email-BodyType     This should always be "text".
> >    SendEmail          (default TRUE) Setting this to FALSE will
> cancel the send of the email
> > Â Â Â
> > Â Â Â Return Values:
> > Â Â Â ------------ --
> > Â Â Â "Cancel Send"Â Â Â Â Â Â Cancels the send of the e-mail.
> > Â Â Â
> > Â Â Â
> > Â Â Â History:
> >    01/12/04 Bab scr7716 - Qualify database references with the
> mfgsys database
> >
> ************ ********* ********* ********* ********* *********
********* ****
> ************ *******/
> > DEFINE PARAMETER BUFFER OLD{&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER {&TableName} FOR mfgsys.{&TableName} .
> > DEFINE PARAMETER BUFFER ChgLogGA FOR mfgsys.ChgLogGA.
> > DEFINE INPUT-OUTPUT PARAMETER Email-From AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-To AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-CC AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Subject AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Text AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-Mime-Header AS CHAR NO-UNDO.
> > DEFINE INPUT-OUTPUT PARAMETER Email-BodyType AS CHAR NO-UNDO.
> > DEFINE OUTPUT PARAMETER SendEmail AS LOGICAL NO-UNDO INIT TRUE.
> > &GLOBAL-DEFINE HTML-Mime "type=text/html: charset=us-
> ascii:filetype= ascii":U
> > &GLOBAL-DEFINE TEXT-Mime "type=text/text: charset=us-
> ascii:filetype= ascii":U
> >
> > ************ ********* ********* ********* ********* *********
********* **
> >
> > I started with just a 'message' .p program to verify that my
> program is compatible with the '.i' file.
> >
> > I have written quite a few programs in 4GL (simple .p follows -
> bulk of which is commented out) :
> >
> > ************ ********* ********* ********* ********* **
> >
> >
> > {V:\mfgsys61\ ud/GlbAlert. i &TableName = "PORel"}
> > DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
> > MESSAGE "changed.." VIEW-AS ALERT-BOX.
> > Â Â Â Â Â Â Â Â Â Â Â Â Â /*********** ********* ********* /
> > /* FIND Customer WHERE (Customer.Company = OrderHed.Company) AND
> > (Customer.CustNum = OrderHed.CustNum)
> > NO-LOCK.
> > FIND OrderDtl WHERE (OrderDtl.Company = OrderHed.Company) AND
> > (OrderDtl.Ordernum = Orderhed.OrderNum)
> > NO-LOCK NO-ERROR.
> > /*Dont send email if "SEND EMAIL" checkbox is not checked */
> > If NOT (orderhed.checkbox0 2) THEN DO:
> > RETURN "CANCEL SEND":U.
> > END.
> > /* Create email */
> > ASSIGN Email-To = " nhutchins@shively. com; nhutchins@howelllab
> s.com"
> > Email-Subject = "New Order# " + STRING(OrderHed. OrderNum)
> > /* Create the new body of the email */
> > NewEmailBody = "~nOrder Number: " + STRING(OrderHed. OrderNum)
> > + "~n~nCustomer: " + STRING(Customer. Name)
> > + "~n~nShip By: " + (IF OrderHed.RequestDat e = ?
> > THEN "see below" ELSE STRING(orderhed. RequestDate) )
> > + "~n~nOrder Date: " + STRING(Orderhed. OrderDate)
> > + "~n~nOrder Lines:~n".
> > /* Lines of Order */
> > FOR EACH OrderDtl of OrderHed no-lock:
> > Assign NewEmailBody = NewEmailBody
> > + " Item " + STRING(OrderDtl. OrderLine) + ": " +
> > STRING(OrderDtl. PartNum) + " " + STRING(OrderDtl. LineDesc)
> > + (IF OrderHed.RequestDat e = ? THEN " Ship By: " +
> > STRING(OrderDtl. RequestDate) ELSE "")
> > + "~n".
> > END.
> > ASSIGN NewEmailBody = NewEmailBody
> > + "~n~nSales Person: " + STRING(OrderHed. SalesRepList)
> > + "~n~nDO NOT REPLY TO THIS E-MAIl ACCOUNT, IT DOES
> > NOT GET REVIEW!".
> > /* Print Email Body */
> > ASSIGN Email-Text = NewEmailBody  */
> >
> > ************ ********* ********* ********* ********* *****
> >
> >
> >
> > Â
> >
> >
> >
> > ____________ _________ _________ __
> > From: Stuart Noble <stuart@>
> > To: vantage@yahoogroups .com
> > Sent: Thursday, March 22, 2007 12:13:29 AM
> > Subject: [Vantage] 6.1 BAM amateur - Help please
> >
> >
> > Two problems.
> >
> > I am trying to get a message to pop up when an Accounts Receivable
> > Invoice is automatically generated for a past fiscal period, and
I
> want
> > it to prompt the person to change the invoice header before it is
> posted
> > to a closed period.
> >
> > Problem 1: I have it triggering off InvcHead.InvoiceNum , but I
> don't
> > even get an email when an invoice is generated after a get
> shipment. Is
> > there a better field to trigger from? I need to at least trigger
an
> > alert before my BAM will work, which it isn't yet! See problem 2!
> >
> > Problem 2:Can anyone see the problem in the following .p for a
BAM.
> When
> > I debug, I get an error about "mismatched number of parameters
> passed to
> > procedure."
> >
> > {ud/GlbAlert. i &TableName = "InvcHead"}
> >
> > Find First GLSyst WHERE GLSyst.Company = InvcHead.Company no-lock.
> >
> > IF Invchead.FiscalPeri od < GLSyst.CurrentFisca lPeriod THEN DO:
> >
> > Message "This Invoice Will be Posted to the WRONG FISCAL PERIOD.
> Please
> > correct before continuing!"
> >
> > View-as alert-box information buttons ok.
> >
> > END.
> >
> > Return "Cancel Send":U.
> >
> > Return.
> >
> > Thanks in advance for any assistance
> >
> > Stuart Noble
> > Thompson Meat Machinery
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]