I'm trying to use the Global Alert system to send out a Shipment
acknowledgement. In a perfect world, for certain customers, I'd
like to have a copy of the BOL go to the customer when it is
shipped. Unfortunately, ShipDtl isn't available for BAM. Using
ShipHead, I have created a notification that items have shipped.
Now I want to add actual line detail to the alert. I know enough
about .P programming to be dangerous. I am definitely stumbling
with the multiple ShipDtl records to the ShipHead. Can anyone offer
some suggestions? Am I going down the completely wrong path?
{ud/GlbAlert.i &tablename = "ShipHead" }
DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
/*new email body*/
IF ShipHead.ReadyToInvoice = TRUE
THEN DO:
FIND CUSTOMER WHERE (Customer.Company = ShipHead.Company) AND
(Customer.CustNum = ShipHead.CustNum)
NO-LOCK.
IF Customer.Checkbox03 = TRUE
THEN DO:
ASSIGN Email-To = mfgsys.Customer.EMailAddress
Email-Subject = "Shipment Alert on "
+ string(ShipHead.PackNum).
FOR EACH SHIPDTL WHERE (ShipDtl.Company =
ShipHead.Company) AND
(ShipDtl.PackNum =
ShipHead.PackNum)
NO-LOCK.
ASSIGN Email-Text = "Items on order number "
+ string(ShipDtl.Packline)
+ " have shipped on "
+ string(ShipDtl.OurInventoryShipQty)
+ " . ".
END.
ELSE DO:
Return "Cancel Send":U.
END.
END.
ELSE DO:
Return "Cancel Send":U.
END.
Thank you,
Jason Hassel
Plymouth Foam
acknowledgement. In a perfect world, for certain customers, I'd
like to have a copy of the BOL go to the customer when it is
shipped. Unfortunately, ShipDtl isn't available for BAM. Using
ShipHead, I have created a notification that items have shipped.
Now I want to add actual line detail to the alert. I know enough
about .P programming to be dangerous. I am definitely stumbling
with the multiple ShipDtl records to the ShipHead. Can anyone offer
some suggestions? Am I going down the completely wrong path?
{ud/GlbAlert.i &tablename = "ShipHead" }
DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
/*new email body*/
IF ShipHead.ReadyToInvoice = TRUE
THEN DO:
FIND CUSTOMER WHERE (Customer.Company = ShipHead.Company) AND
(Customer.CustNum = ShipHead.CustNum)
NO-LOCK.
IF Customer.Checkbox03 = TRUE
THEN DO:
ASSIGN Email-To = mfgsys.Customer.EMailAddress
Email-Subject = "Shipment Alert on "
+ string(ShipHead.PackNum).
FOR EACH SHIPDTL WHERE (ShipDtl.Company =
ShipHead.Company) AND
(ShipDtl.PackNum =
ShipHead.PackNum)
NO-LOCK.
ASSIGN Email-Text = "Items on order number "
+ string(ShipDtl.Packline)
+ " have shipped on "
+ string(ShipDtl.OurInventoryShipQty)
+ " . ".
END.
ELSE DO:
Return "Cancel Send":U.
END.
END.
ELSE DO:
Return "Cancel Send":U.
END.
Thank you,
Jason Hassel
Plymouth Foam