FW: Progress BAM

From: Late, Travis
Sent: Thursday, March 04, 2010 3:37 PM
To: 'vantage@yahoogroups.com'
Subject: RE: [Vantage] Progress BAM



This is the code I have right now. I was using somebody else's code for
the OrderDtl Info so I'm not certain where to put that. All I want to do
is add the line information in the email. Seems like it should be easy
enough.



{ud/GlbAlert.i &tablename = "OrderHed" }



DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.



/*new email body*/

IF OrderHed.CheckBox02 = TRUE

THEN DO:



FIND Customer WHERE Customer.Company = OrderHed.Company AND
Customer.CustNum = OrderHed.BTCustNum NO-LOCK.

FIND OrderDtl WHERE OrderDtl.Company = OrderHed.Company AND
OrderDtl.Ordernum = Orderhed.OrderNum NO-LOCK no-error.

FIND ShipTo WHERE ShipTo.Company = OrderHed.Company and ShipTo.CustNum =
OrderHed.CustNum and ShipTo.ShipToNum = OrderHed.ShipToNum no-lock
no-error.

IF OrderHed.Checkbox02 = TRUE

THEN DO:

ASSIGN Email-To = "tlate@..."



Email-Subject = "New Sales Order # "

+ string(OrderHed.OrderNum)

Email-Text = "Items on order number "

+ "~n~n Order Number: " +
STRING(OrderHed.OrderNum)

+ "~n Order Date: " + STRING(Orderhed.OrderDate)

+ "~n Your PO Number: " + STRING(Orderhed.PONum)

+ "~n Order Total: $" + STRING(Orderhed.CCAmount)

+ "~n~n Bill to: " + STRING(Customer.Name) + ", " +
STRING(Customer.Address1) + ", " + STRING(Customer.City) + ", " +
STRING(Customer.State) + ", " + STRING(Customer.ZIP)

+ "~n Ship to: " + STRING(ShipTo.Name) + ", " + STRING(ShipTo.Address1)
+ ", " + STRING(ShipTo.City) + ", " + STRING(ShipTo.State) + ", " +
STRING(ShipTo.ZIP)

+ "~n Expected Ship Date: " + (IF OrderHed.RequestDate = ? THEN "see
below" ELSE STRING(orderhed.RequestDate)).



End.

End.

/* If the order is not */

ELSE DO:

RETURN "CANCEL SEND":U.

END.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Butch Menge
Sent: Thursday, March 04, 2010 3:02 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Progress BAM





What does your code look like with the "for each" lines in it?

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Late, Travis
Sent: Thursday, March 04, 2010 12:56 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Progress BAM

Unfortunately that did not work. Not sure what the problem is with this.

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Butch Menge
Sent: Thursday, March 04, 2010 1:31 PM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Progress BAM

I'm not familiar with the "of" command (I'm in 6.10 land and it may
exist - I just never used it). I've done something similar for receipts
of shortages where I send an alert to users to let them know the part
has arrived. Here is how I added the order detail:

ASSIGN NewEmailBody = NewEmailBody + "~nOrders:~n".

FOR EACH OrderRel WHERE (OrderRel.OpenRelease) AND
(OrderRel.PartNum = RcvDtl.PartNum):

ASSIGN NewEmailBody = NewEmailBody + "Order: " +
string(OrderRel.OrderNum) + " Line: " + string(OrderRel.OrderLine) +

" Release: " + string(OrderRel.OrderRelNum) + " Qty
Remaining: " +

string(OrderRel.SellingReqQty -
OrderRel.OurStockShippedQty - OrderRel.OurJobShippedQty) + "~n".

END.

So I would try changing your for each statement to something like:

FOR EACH OrderDtl where (OrderDtl.OrderNum = OrderHed.OrderNum no-lock:

Good luck,

Butch

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Late, Travis
Sent: Thursday, March 04, 2010 11:17 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Progress BAM

I set up a .p program to send an email alert to a group designated to
receive the email when a sales order is checked send email. Everything
works fine with what I have below , but I want to add Order line details
to this .p program. I would like to add this, but always get an error.
Any ideas how I can add the order lines to this .p?

Thanks in advance.

What I'd like to add

/* Lines of Order */

ASSIGN NewEmailBody = NewEmailBody

+ "~n~n~nOrder Lines:~n".

FOR EACH OrderDtl of OrderHed no-lock:

Assign NewEmailBody = NewEmailBody

+ " Item " + STRING(OrderDtl.OrderLine) + ":~t"

+ STRING(OrderDtl.PartNum) + " " + STRING(OrderDtl.LineDesc)

+ ":~t" + STRING(OrderDtl.OrderQty) + " piece(s)"

+ (IF OrderHed.RequestDate = ? THEN ":~tShip By: "

+ STRING(OrderDtl.RequestDate) ELSE "")

+ "~n".

What I currently have working

{ud/GlbAlert.i &tablename = "OrderHed" }

DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.

/*new email body*/

IF OrderHed.CheckBox02 = TRUE

THEN DO:

FIND Customer WHERE Customer.Company = OrderHed.Company AND
Customer.CustNum = OrderHed.BTCustNum NO-LOCK.

FIND OrderDtl WHERE OrderDtl.Company = OrderHed.Company AND
OrderDtl.Ordernum = Orderhed.OrderNum NO-LOCK no-error.

FIND ShipTo WHERE ShipTo.Company = OrderHed.Company and ShipTo.CustNum =
OrderHed.CustNum and ShipTo.ShipToNum = OrderHed.ShipToNum no-lock
no-error.

IF OrderHed.Checkbox02 = TRUE

THEN DO:

ASSIGN Email-To = "tlate@... <mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com> "

Email-Subject = "New Sales Order # "

+ string(OrderHed.OrderNum)

Email-Text = "Items on order number "

+ "~n~n Order Number: " +
STRING(OrderHed.OrderNum)

+ "~n Order Date: " + STRING(Orderhed.OrderDate)

+ "~n Your PO Number: " + STRING(Orderhed.PONum)

+ "~n~n Bill to: " + STRING(Customer.Name) + ", " +
STRING(Customer.Address1) + ", " + STRING(Customer.City) + ", " +
STRING(Customer.State) + ", " + STRING(Customer.ZIP)

+ "~n Ship to: " + STRING(ShipTo.Name) + ", " + STRING(ShipTo.Address1)
+ ", " + STRING(ShipTo.City) + ", " + STRING(ShipTo.State) + ", " +
STRING(ShipTo.ZIP)

+ "~n Expected Ship Date: " + (IF OrderHed.RequestDate = ? THEN "see
below" ELSE STRING(orderhed.RequestDate)).

End.

End.

/* If the order is not shipped */

ELSE DO:

RETURN "CANCEL SEND":U.

END.

Travis Late

ERP Project Manager

M-B Companies, Inc

1200 Park Street

Chilton, WI 53014

Phone: 920-898-1560 Ext.152

Cell: 920-960-0062

Email: tlate@... <mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate@... <mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com>
<mailto:tlate%40m-bco.com> >

M-B Companies Confidentiality Notice:
This message is being sent by M-B Companies. It is intended exclusively
for
the individuals and entities to which it is addressed. This
communication,
including any attachments, may contain information that is proprietary,
privileged and confidential if you are not the named addressee; you are
not
authorized to read,print,retain copy or disseminate this message or any
part
of it.If you have received this message in error, please notify the
sender
immediately by email.

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

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

M-B Companies Confidentiality Notice:
This message is being sent by M-B Companies. It is intended exclusively
for
the individuals and entities to which it is addressed. This
communication,
including any attachments, may contain information that is proprietary,
privileged and confidential if you are not the named addressee; you are
not
authorized to read,print,retain copy or disseminate this message or any
part
of it.If you have received this message in error, please notify the
sender
immediately by email.

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

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






M-B Companies Confidentiality Notice:
This message is being sent by M-B Companies. It is intended exclusively for
the individuals and entities to which it is addressed. This communication,
including any attachments, may contain information that is proprietary,
privileged and confidential if you are not the named addressee; you are not
authorized to read,print,retain copy or disseminate this message or any part
of it.If you have received this message in error, please notify the sender
immediately by email.

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