We have a field on our Order Entry form for “Entered For”, this is use when someone enters in a sales order for a one of our customer service team is out of the office.
I’m working on a Post-Proc method BPM that will email the customer. I’m having problems getting it to pull the Entered For field on OrderHed table. Which is then failing to pull the email address from the UserFile table.
Probably something obvious I’m missing but here is the code snip. EnteredFor & EnteredForEmailAddr are BPM variables used in the outbound email.
Erp.Tables.OrderHed dbOrderHed; // Declare var
Erp.Tables.UserFile dbUserFile; // Declare var
var dbOrderHed_Recs = (from dbOrderHed_Row in Db.OrderHed
where dbOrderHed_Row.Company == Session.CompanyID
&& dbOrderHed_Row.OrderNum == OrderNumBPM
select dbOrderHed_Row).FirstOrDefault();
{
// var ttOrderHed = dbOrderHed_Recs;
if (dbOrderHed_Recs != null)
{
EnteredFor = dbOrderHed_Recs.udEnteredFor_c;
foreach (var dbUserFile_Recs in (from dbUserFile_Row in Db.UserFile
where dbUserFile_Row.DcdUserID == dbOrderHed_Recs.udEnteredFor_c
select dbUserFile_Row))
{
// var ttOrderDtlRow = dbUserFile_Recs;
if (dbUserFile_Recs != null)
{
EnteredForEmailAddr = dbUserFile_Recs.EMailAddress;
}
} // UserFile
}
} //OrderHed