0
votes

I created a new field, UsrAcknowledged, boolean, checkbox, and placed it on the SOLine details grid. I want every line on the details grid to be checked when the Email Sales Order/Quote process is run under Actions for SOOrder. My code is as follows under the SOOrderEntry_Extension:PXGraphExtension

  public CRActivityList<SOOrder>    Activity;
  public PXAction<SOOrder> notification;
  [PXUIField(DisplayName = "Notifications", Visible = false)]
  [PXButton(ImageKey = PX.Web.UI.Sprite.Main.DataEntryF)]
  protected virtual IEnumerable Notification(PXAdapter adapter,
  [PXString]
  string notificationCD
  )
  {
    foreach (SOOrder order in adapter.Get<SOOrder>())
    {

      var parameters = new Dictionary<string, string>();
      parameters["SOOrder.OrderType"] = order.OrderType;
      parameters["SOOrder.OrderNbr"] = order.OrderNbr;
     Activity.SendNotification(ARNotificationSource.Customer,          notificationCD, order.BranchID, parameters);
//order.OrderDesc = "Desc";
  foreach (SOLine line in PXSelect<SOLine>.Select(Base, order.OrderNbr))
  {
       SOLineExt rowExt = line.GetExtension<SOLineExt>();
       rowExt.UsrAcknowledged = true;
           line.OrderQty = 5;
  }
  yield return order;
}

}

//order.Desc = "Desc" was an initial simple test just to see if my code was achieving the desired results and the proder desciption was changed as planned. My code compiles and the email process runs as planned with a green check for successful, but neither the Acknowledged check box nor the Order Quantity are changed. I don't really care about the ord qty, it was just another test. Any suggestions for what I can change to update the Acknowledged checkbox to checked during the Email Sales Order/Quote under Actions on the SO Order Entry screen would be appreciated

1

1 Answers

0
votes

I would say you need to call Base.Transactions.Update(line) after you update your row values inside your foreach.