Update OrderHed.OrderComments with UD04.Key1

I am trying to update the OrderHed.OrderComments field from the UD04.Key1 value. How would something like this be done in a data directive?


I would use a method directive in Post-Processing on SalesOrder.ChangeCustomer

Ice.Tables.UD04 UD04;
var OrdHed = (from r in ttOrderHed where r.Added() || r.Updated()
select r).FirstOrDefault();

if (OrdHed != null)
var UD = (from k in Db.UD04
where k.Company == Session.CompanyID
select k).FirstOrDefault();
    OrdHed["OrderComments"] = UD.Key1;

Hopefully you won’t get any data selection issues due to only having a relationship with Company unless you’re passing data from OrderHed to UD04 e.g OrderNum, CustNum then you will know you’re pulling back the correct data from UD04.Key1 unless it’s just a standard piece of information then you shouldn’t have any issues.

Kind regards,

Hi Chia. I would enjoy getting together with you and going over the solution we’ve put together in the last couple of weeks. Feel free to book something on Teams.