9.05.605 - BPM Email to - using variable and an email

Took a while for me to get to this but, the syntax worked.

 

Thank you Greg!

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, May 25, 2016 7:09 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] 9.05.605 - BPM Email to - using variable and an email

 

 

 

Here is how I add them together in a bam.

 

assign vCC  = "info@...;planner@...".

assign vCC = vCC + ";buyer@...".

 

The BAM I use for our DMR to buyer is below.

 

Greg

 

 

 

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

/* FailedDMR.p this alert is used when a part is rejected in the DMR process */

 

ASSIGN SendEmail = FALSE.

 

define variable ExtCost as decimal no-undo initial 0.

define variable TotQty    as decimal no-undo initial 0.

define variable TotStd    as decimal no-undo initial 0.

define variable CostAtStd as decimal no-undo initial 0.

define variable CostAtPO  as decimal no-undo initial 0.

define variable POQty  as decimal no-undo initial 0.

define variable STDVariance    as decimal no-undo initial 0.

define variable STDMaterialCost    as decimal no-undo initial 0.

define variable EmailAddress as Character no-undo initial '':U.

define variable UserName as Character no-undo initial '':U.

define variable vFrom as character no-undo initial '':U.

define variable vTo as character no-undo initial '':U.

define variable vCC as character no-undo initial '':U.

define variable vSubject as character no-undo initial '':U.

define variable vBody as character no-undo initial '':U.

 

Find first UserFile where UserFile.DCDUserID = DCD-UserID no-lock no-error.

assign EMAIL-From = UserFile.EmailAddress. /* epicor user */

Find first DMRHead no-lock where DMRHead.Company = DMRActn.Company and DMRHead.DMRNum = DMRActn.DMRNum.

Find first Vendor no-lock where Vendor.Company = DMRActn.Company and Vendor.VendorNum = DMRHead.VendorNum.

Find first Part where Part.Company = DMRHead.Company and Part.PartNum = DMRHead.PartNum no-lock.

 

 

Find Reason no-lock where Reason.Company = DMRActn.Company and Reason.ReasonCode = DMRActn.ReasonCode.

 

Find first PartClass where PartClass.Company = Part.Company and PartClass.ClassID = Part.ClassID.

Find first UserFile where UserFile.DCDUserID = PartClass.BuyerID no-lock no-error.

if not available UserFile Then

                                vTO = "no_buyer_email@...".

                               

assign vTO  =  UserFile.EmailAddress. /* buyer */

 

assign ExtCost = DMRHead.AvgMtlUnitCost * DMRActn.Quantity.

                               

Assign vBody  = "Insp Failed at DMR Number: " + string(DMRHead.DMRNum) +

                "~n~n~tDate: " + string(DMRActn.ActionDate,"99/99/99") +

                "~n~n~tPart: " + DMRHead.PartNum +

                "~n~n~tDescription: " + DMRHead.PartDescription +

                "~n~n~tTot Rejected Qty: " + string(DMRActn.Quantity) +

                "~n~n~tMaterial Cost: " + string(DMRHead.AvgMtlUnitCost,"$>>>,>>>,>>9.99") +

                "~n~n~tExt Material Cost: " + string(ExtCost,"$>>>,>>>,>>9.99") +

                "~n~n~tWarehouse Code: " + DMRHead.WarehouseCode +

                "~n~n~tBin Num: " + DMRHead.BinNum +

                "~n~n~tUOM: " + DMRHead.IUM +

                "~n~n~tVend RMA Number: " + string(DMRActn.VendRMANum) +

                "~n~n~tSupplier Number: " + string(Vendor.VendorID) + "   "  + string(Vendor.Name) +

                "~n~n~tReason: " + string(DMRActn.Reason) + "   " + TRIM(string(Reason.Description)) +

                "~n~n~tResolution: " + string(DMRActn.Resolution) +

                "~n~n~tComments: " + string(trim(DMRActn.CommentText)).

 

assign vCC  = "info@...".

 

 

assign vCC = vCC + ";planner@...".

 

assign EMAIL-To = vTO.

assign EMAIL-CC = vCC.

assign EMAIL-Subject =  'New DMR: ' + trim(string(DMRHead.DMRNum)).

assign EMAIL-Text = vBody.

assign SendEmail = true.

 

 

 

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, May 25, 2016 5:33 PM
To: vantage@yahoogroups.com
Subject: [Vantage] 9.05.605 - BPM Email to - using variable and an email

 

 

I am writing a BPM to email a Buyer or Planner and Quality department  when I DMR is dispositioned as RTV or Rework.

I made a variable for the Buyer or Planners email address since they will not want emails that aren't necessary.  For quality it is quality@....

I am having a problem with syntax when combining the two types.

assign vTo = 'vPlanner, quality@...' .

Any help will be appreciated.


 

 



CONFIDENTIALITY NOTICE

The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at 727-578-6240 and immediately delete the communication.

"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."

1 Like
I am writing a BPM to email a Buyer or Planner and Quality department  when I DMR is dispositioned as RTV or Rework.

I made a variable for the Buyer or Planners email address since they will not want emails that aren't necessary.  For quality it is quality@....

I am having a problem with syntax when combining the two types.

assign vTo = 'vPlanner, quality@...' .

Any help will be appreciated.



 

Here is how I add them together in a bam.

 

assign vCC  = "info@...;planner@...".

assign vCC = vCC + ";buyer@...".

 

The BAM I use for our DMR to buyer is below.

 

Greg

 

 

 

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

/* FailedDMR.p this alert is used when a part is rejected in the DMR process */

 

ASSIGN SendEmail = FALSE.

 

define variable ExtCost as decimal no-undo initial 0.

define variable TotQty    as decimal no-undo initial 0.

define variable TotStd    as decimal no-undo initial 0.

define variable CostAtStd as decimal no-undo initial 0.

define variable CostAtPO  as decimal no-undo initial 0.

define variable POQty  as decimal no-undo initial 0.

define variable STDVariance    as decimal no-undo initial 0.

define variable STDMaterialCost    as decimal no-undo initial 0.

define variable EmailAddress as Character no-undo initial '':U.

define variable UserName as Character no-undo initial '':U.

define variable vFrom as character no-undo initial '':U.

define variable vTo as character no-undo initial '':U.

define variable vCC as character no-undo initial '':U.

define variable vSubject as character no-undo initial '':U.

define variable vBody as character no-undo initial '':U.

 

Find first UserFile where UserFile.DCDUserID = DCD-UserID no-lock no-error.

assign EMAIL-From = UserFile.EmailAddress. /* epicor user */

Find first DMRHead no-lock where DMRHead.Company = DMRActn.Company and DMRHead.DMRNum = DMRActn.DMRNum.

Find first Vendor no-lock where Vendor.Company = DMRActn.Company and Vendor.VendorNum = DMRHead.VendorNum.

Find first Part where Part.Company = DMRHead.Company and Part.PartNum = DMRHead.PartNum no-lock.

 

 

Find Reason no-lock where Reason.Company = DMRActn.Company and Reason.ReasonCode = DMRActn.ReasonCode.

 

Find first PartClass where PartClass.Company = Part.Company and PartClass.ClassID = Part.ClassID.

Find first UserFile where UserFile.DCDUserID = PartClass.BuyerID no-lock no-error.

if not available UserFile Then

                                vTO = "no_buyer_email@...".

                               

assign vTO  =  UserFile.EmailAddress. /* buyer */

 

assign ExtCost = DMRHead.AvgMtlUnitCost * DMRActn.Quantity.

                               

Assign vBody  = "Insp Failed at DMR Number: " + string(DMRHead.DMRNum) +

                "~n~n~tDate: " + string(DMRActn.ActionDate,"99/99/99") +

                "~n~n~tPart: " + DMRHead.PartNum +

                "~n~n~tDescription: " + DMRHead.PartDescription +

                "~n~n~tTot Rejected Qty: " + string(DMRActn.Quantity) +

                "~n~n~tMaterial Cost: " + string(DMRHead.AvgMtlUnitCost,"$>>>,>>>,>>9.99") +

                "~n~n~tExt Material Cost: " + string(ExtCost,"$>>>,>>>,>>9.99") +

                "~n~n~tWarehouse Code: " + DMRHead.WarehouseCode +

                "~n~n~tBin Num: " + DMRHead.BinNum +

                "~n~n~tUOM: " + DMRHead.IUM +

                "~n~n~tVend RMA Number: " + string(DMRActn.VendRMANum) +

                "~n~n~tSupplier Number: " + string(Vendor.VendorID) + "   "  + string(Vendor.Name) +

                "~n~n~tReason: " + string(DMRActn.Reason) + "   " + TRIM(string(Reason.Description)) +

                "~n~n~tResolution: " + string(DMRActn.Resolution) +

                "~n~n~tComments: " + string(trim(DMRActn.CommentText)).

 

assign vCC  = "info@...".

 

 

assign vCC = vCC + ";planner@...".

 

assign EMAIL-To = vTO.

assign EMAIL-CC = vCC.

assign EMAIL-Subject =  'New DMR: ' + trim(string(DMRHead.DMRNum)).

assign EMAIL-Text = vBody.

assign SendEmail = true.

 

 

 

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, May 25, 2016 5:33 PM
To: vantage@yahoogroups.com
Subject: [Vantage] 9.05.605 - BPM Email to - using variable and an email

 

 

I am writing a BPM to email a Buyer or Planner and Quality department  when I DMR is dispositioned as RTV or Rework.

I made a variable for the Buyer or Planners email address since they will not want emails that aren't necessary.  For quality it is quality@....

I am having a problem with syntax when combining the two types.

assign vTo = 'vPlanner, quality@...' .

Any help will be appreciated.

 




CONFIDENTIALITY NOTICE

The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at 727-578-6240 and immediately delete the communication.

"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."