​/* PendShipDate Ack EMail -- Adapted from NewOrder Ack code Finshed: 7/27/2015 *//* Updated to add division (HLI or SLI) logic 9/18/2015 */string bpmFrom = string.Empty;string bpmTo = string.Empty;string bpmSubject = string.Empty;string bpmBody = string.Empty;string bpmReqDate = string.Empty;string SetORChanged = string.Empty;string ttPendDate = string.Empty;string Status = string.Empty;//string msg = string.Empty;var ttORel = (from  row in ttOrderRel select row).LastOrDefault();if (ttORel != null){Erp.Tables.OrderHed OrderHed = (from OrderHed_Row in Db.OrderHedwhere (OrderHed_Row.Company == ttORel.Company) &&(OrderHed_Row.OrderNum == ttORel.OrderNum)select OrderHed_Row).FirstOrDefault();Erp.Tables.OrderDtl OrderDtl = (from OrderDtl_Row in Db.OrderDtlwhere (OrderDtl_Row.Company == ttORel.Company) &&(OrderDtl_Row.OrderNum == ttORel.OrderNum) &&(OrderDtl_Row.OrderLine == ttORel.OrderLine)select OrderDtl_Row).FirstOrDefault();Erp.Tables.OrderRel OrderRel = (from OrderRel_Row in Db.OrderRelwhere (OrderRel_Row.Company == ttORel.Company) &&(OrderRel_Row.OrderNum == ttORel.OrderNum) &&(OrderRel_Row.OrderLine == ttORel.OrderLine) &&(OrderRel_Row.OrderRelNum == ttORel.OrderRelNum)select OrderRel_Row).FirstOrDefault();Erp.Tables.Customer Customer = (from Customer_Row in Db.Customerwhere (Customer_Row.Company == OrderHed.Company) &&(Customer_Row.CustNum == OrderHed.CustNum)select Customer_Row).FirstOrDefault();//Check if PendShipDate Changed during updateif (ttORel.Date01 != OrderRel.Date01){Status = "With a Status of " + OrderRel.Character01;//Check if PendShipDate was set or changedif (ttORel.Date01 == null){SetORChanged = "Set";ttPendDate = "was set to " + String.Format("{0:M/d/yyyy}",ttORel.Date01);}else{SetORChanged = "Changed";ttPendDate = "was changed from " + String.Format("{0:M/d/yyyy}",OrderRel.Date01) + " to " + String.Format("{0:M/d/yyyy}",ttORel.Date01);}// Build Email HeaderbpmFrom = "howell@...";// Check which Divisionif (Customer.TerritoryID == "HLI"){bpmTo = "pendingalert@...";}else{bpmTo = "pendingalert@...";}bpmSubject = "Pending Ship Date " + SetORChanged + " for "Â+ System.Convert.ToString(ttORel.OrderNum) + "-" + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum);bpmReqDate = String.Format("{0:M/d/yyyy}",OrderHed.RequestDate);// Build Email Body: Order HeaderbpmBody =Â"The Pending Ship Date " + ttPendDate + " for Order: "Â+ System.Convert.ToString(ttORel.OrderNum) + "-" + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum) +Â"\n" + Status + "\n\n" +"\nOrder Number: " + System.Convert.ToString(ttORel.OrderNum) +Â"\n\nCustomer: " + System.Convert.ToString(Customer.Name) +Â"\n\nOrder Date: " + String.Format("{0:M/d/yyyy}",OrderHed.OrderDate) +Â"\n\nShip By: " + bpmReqDate +Â"\n\nOrder Line:\n" +"   Item " + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum) +":  " + System.Convert.ToString(OrderDtl.PartNum) +Â"  " + System.Convert.ToString(OrderDtl.LineDesc) +Â"\n       Qty:  " +  OrderDtl.OrderQty.ToString("F") + " " + System.Convert.ToString(OrderDtl.SalesUM) +"  Ship By:  " + String.Format("{0:M/d/yyyy}",OrderDtl.RequestDate) +Â"\nLINE COMMENTS:\n" + OrderDtl.OrderComment +"\n";// Build Email Body: FooterbpmBody = bpmBody +Â"_______________________________" +"\nSales Person: " + System.Convert.ToString(OrderHed.SalesRepList) +Â"\n\nHEADER COMMENTS: \n" + System.Convert.ToString(OrderHed.OrderComment) +Â"\n\n\nPLEASE NOTE: This e-mail was sent from a notification-only address\nthat cannot accept incoming e-mail. Do not reply to this message";// Send Emailvar mailer = GetMailer(async: true);var message = new Ice.Mail.SmtpMail();message.SetFrom(bpmFrom);message.SetTo(bpmTo);message.SetSubject(bpmSubject);message.SetBody(bpmBody);mailer.Send(message);}}
<div id="ygrps-yiv-162490884yiv0961631965ygrp-text">
<div></div><div dir="ltr"><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-family:verdana, sans-serif;"><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;">I have a Intransit Data Directive BPM on OrderRel (using a custom code), where when custom date field (PendShipDate_c) is changed an email is sent out. This works really well except, that it turns out it also stops the deletion of any Order, OrderDtl, or OrderRel record. Big ambiguous error messages in Epicor that took support 2 weeks to figure out... oops.</div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;"><br clear="none"></div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;">So I thought, "oh I need to add the RowMod = "A" or "U" logic, however RowMod isn't available in a Data Directives. </div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;"><br clear="none"></div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;">Can I do something similar in a Method? Even if the field in question is being changed in an Updateable Dashboard? I also need the before and after value.</div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;"><br clear="none"></div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;">Code Below...</div><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-size:12.8px;"><br clear="none"></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><div>Thanks,</div><div><br clear="none"></div><div>Norman Hutchins</div><div>System Administrator</div><div>Howell Laboratories, Inc.</div></div></div><blockquote><span title="qreply"> <blockquote style="margin:0 0 0 40px;padding:0px;"><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><div><br clear="none"></div></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><div class="ygrps-yiv-162490884yiv0961631965gmail_default" style="font-family:verdana, sans-serif;">​</div><font face="verdana, sans-serif">/* PendShipDate Ack EMail -- Adapted from NewOrder Ack code Finshed: 7/27/2015 */</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">/* Updated to add division (HLI or SLI) logic 9/18/2015 */</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><br clear="none"></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string bpmFrom = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string bpmTo = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string bpmSubject = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string bpmBody = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string bpmReqDate = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string SetORChanged = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string ttPendDate = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">string Status = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">//string msg = string.Empty;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">var ttORel = (from row in ttOrderRel select row).LastOrDefault();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">if (ttORel != null)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>Erp.Tables.OrderHed OrderHed = (from OrderHed_Row in Db.OrderHed</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>where (OrderHed_Row.Company == ttORel.Company) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderHed_Row.OrderNum == ttORel.OrderNum)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>select OrderHed_Row).FirstOrDefault();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>Erp.Tables.OrderDtl OrderDtl = (from OrderDtl_Row in Db.OrderDtl</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>where (OrderDtl_Row.Company == ttORel.Company) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderDtl_Row.OrderNum == ttORel.OrderNum) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderDtl_Row.OrderLine == ttORel.OrderLine)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>select OrderDtl_Row).FirstOrDefault();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>Erp.Tables.OrderRel OrderRel = (from OrderRel_Row in Db.OrderRel</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>where (OrderRel_Row.Company == ttORel.Company) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderRel_Row.OrderNum == ttORel.OrderNum) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderRel_Row.OrderLine == ttORel.OrderLine) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(OrderRel_Row.OrderRelNum == ttORel.OrderRelNum)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>select OrderRel_Row).FirstOrDefault();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>Erp.Tables.Customer Customer = (from Customer_Row in Db.Customer</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>where (Customer_Row.Company == OrderHed.Company) &&</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>(Customer_Row.CustNum == OrderHed.CustNum)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>select Customer_Row).FirstOrDefault();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">//Check if PendShipDate Changed during update</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>if (ttORel.Date01 != OrderRel.Date01)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>Status = "With a Status of " + OrderRel.Character01;</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>//Check if PendShipDate was set or changed</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>if (ttORel.Date01 == null)</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>SetORChanged = "Set";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>ttPendDate = "was set to " + String.Format("{0:M/d/yyyy}",ttORel.Date01);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><br clear="none"></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>}</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>else</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>SetORChanged = "Changed";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>ttPendDate = "was changed from " + String.Format("{0:M/d/yyyy}",OrderRel.Date01) + " to " + String.Format("{0:M/d/yyyy}",ttORel.Date01);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><br clear="none"></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>}</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>// Build Email Header</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmFrom = "<a rel="nofollow" shape="rect" target="_blank" href="mailto:howell@...">howell@...</a>";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>// Check which Division</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>if (Customer.TerritoryID == "HLI")</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmTo = "<a rel="nofollow" shape="rect" target="_blank" href="mailto:pendingalert@...">pendingalert@...</a>";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>}</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>else</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>{</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmTo = "<a rel="nofollow" shape="rect" target="_blank" href="mailto:pendingalert@...">pendingalert@...</a>";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>}</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmSubject = "Pending Ship Date " + SetORChanged + " for " </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>+ System.Convert.ToString(ttORel.OrderNum) + "-" + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmReqDate = String.Format("{0:M/d/yyyy}",OrderHed.RequestDate);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>// Build Email Body: Order Header</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmBody = </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"The Pending Ship Date " + ttPendDate + " for Order: " </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>+ System.Convert.ToString(ttORel.OrderNum) + "-" + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n" + Status + "\n\n" +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\nOrder Number: " + System.Convert.ToString(ttORel.OrderNum) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\nCustomer: " + System.Convert.ToString(Customer.Name) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\nOrder Date: " + String.Format("{0:M/d/yyyy}",OrderHed.OrderDate) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\nShip By: " + bpmReqDate + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\nOrder Line:\n" +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>" Item " + System.Convert.ToString(ttORel.OrderLine) + "-" + System.Convert.ToString(ttORel.OrderRelNum) +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>": " + System.Convert.ToString(OrderDtl.PartNum) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>" " + System.Convert.ToString(OrderDtl.LineDesc) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n Qty: " + OrderDtl.OrderQty.ToString("F") + " " + System.Convert.ToString(OrderDtl.SalesUM) +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>" Ship By: " + String.Format("{0:M/d/yyyy}",OrderDtl.RequestDate) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\nLINE COMMENTS:\n" + OrderDtl.OrderComment +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"><font face="verdana, sans-serif"> </font></span></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>// Build Email Body: Footer</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>bpmBody = bpmBody + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"_______________________________" +</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\nSales Person: " + System.Convert.ToString(OrderHed.SalesRepList) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\nHEADER COMMENTS: \n" + System.Convert.ToString(OrderHed.OrderComment) + </font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>"\n\n\nPLEASE NOTE: This e-mail was sent from a notification-only address\nthat cannot accept incoming e-mail. Do not reply to this message";</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><br clear="none"></font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>// Send Email</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>var mailer = GetMailer(async: true);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>var message = new Ice.Mail.SmtpMail();</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>message.SetFrom(bpmFrom);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>message.SetTo(bpmTo);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>message.SetSubject(bpmSubject);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>message.SetBody(bpmBody);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>mailer.Send(message);</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif"><span class="ygrps-yiv-162490884yiv0961631965class" style="white-space:pre;"> </span>}</font></div></div><div><div class="ygrps-yiv-162490884yiv0961631965gmail_signature"><font face="verdana, sans-serif">}</font></div></div></blockquote>
</div>
<div style="color:#fff;height:0;"></div></div>
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp hr {
border:1px solid #d8d8d8;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp #ygrps-yiv-162490884yiv0961631965hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp #ygrps-yiv-162490884yiv0961631965ads {
margin-bottom:10px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp .ygrps-yiv-162490884yiv0961631965ad {
padding:0 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp .ygrps-yiv-162490884yiv0961631965ad p {
margin:0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mkp .ygrps-yiv-162490884yiv0961631965ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ygrp-lc {
font-family:Arial;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ygrp-lc #ygrps-yiv-162490884yiv0961631965hd {
margin:10px 0px;font-weight:700;font-size:78%;line-height:122%;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ygrp-lc .ygrps-yiv-162490884yiv0961631965ad {
margin-bottom:10px;padding:0 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965actions {
font-family:Verdana;font-size:11px;padding:10px 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity {
background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity span {
font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity span:first-child {
text-transform:uppercase;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity span a {
color:#5085b6;text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity span span {
color:#ff7900;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965activity span .ygrps-yiv-162490884yiv0961631965underline {
text-decoration:underline;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965attach {
clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 0;width:400px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965attach div a {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965attach img {
border:none;padding-right:5px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965attach label {
display:block;margin-bottom:5px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965attach label a {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 blockquote {
margin:0 0 0 4px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965bold {
font-family:Arial;font-size:13px;font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965bold a {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 dd.ygrps-yiv-162490884yiv0961631965last p a {
font-family:Verdana;font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 dd.ygrps-yiv-162490884yiv0961631965last p span {
margin-right:10px;font-family:Verdana;font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 dd.ygrps-yiv-162490884yiv0961631965last p span.ygrps-yiv-162490884yiv0961631965yshortcuts {
margin-right:0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965attach-table div div a {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965attach-table {
width:400px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965file-title a, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965file-title a:active, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965file-title a:hover, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965file-title a:visited {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965photo-title a, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965photo-title a:active, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965photo-title a:hover, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div.ygrps-yiv-162490884yiv0961631965photo-title a:visited {
text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 div#ygrps-yiv-162490884yiv0961631965ygrp-mlmsg #ygrps-yiv-162490884yiv0961631965ygrp-msg p a span.ygrps-yiv-162490884yiv0961631965yshortcuts {
font-family:Verdana;font-size:10px;font-weight:normal;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965green {
color:#628c2a;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965MsoNormal {
margin:0 0 0 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 o {
font-size:0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965photos div {
float:left;width:72px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965photos div div {
border:1px solid #666666;height:62px;overflow:hidden;width:62px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965photos div label {
color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965reco-category {
font-size:77%;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965reco-desc {
font-size:77%;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 .ygrps-yiv-162490884yiv0961631965replbq {
margin:4px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-actbar div a:first-child {
margin-right:2px;padding-right:5px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg {
font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg table {
font-size:inherit;font:100%;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg select, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 input, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 textarea {
font:99% Arial, Helvetica, clean, sans-serif;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg pre, #ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 code {
font:115% monospace;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg * {
line-height:1.22em;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-mlmsg #ygrps-yiv-162490884yiv0961631965logo {
padding-bottom:10px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-msg p a {
font-family:Verdana;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-msg p#ygrps-yiv-162490884yiv0961631965attach-count span {
color:#1E66AE;font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-reco #ygrps-yiv-162490884yiv0961631965reco-head {
color:#ff7900;font-weight:700;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-reco {
margin-bottom:20px;padding:0px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ov li a {
font-size:130%;text-decoration:none;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ov li {
font-size:77%;list-style-type:square;padding:6px 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-sponsor #ygrps-yiv-162490884yiv0961631965ov ul {
margin:0;padding:0 0 0 8px;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-text {
font-family:Georgia;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-text p {
margin:0 0 1em 0;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-text tt {
font-size:120%;}
#ygrps-yiv-162490884 #ygrps-yiv-162490884yiv0961631965 #ygrps-yiv-162490884yiv0961631965ygrp-vital ul li:last-child {
border-right:none !important;}
#ygrps-yiv-162490884
You do have access to the row mod, just not the way you think. Try using this:
var ttORel = (from ttORel_Row in ttOrderRel
where (string.Equals(ttORel_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase)) || (string.Equals(ttORel_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase))
select ttORel_Row).FirstOrDefault();
This will get you the updated or added row you are looking for. Don't use LastOrDefault when querying. Only use it on List when you know you want the last. Its risky and can break things like in this scenario.