Ordernum to UD

Trying to use a Data Directive to write the ordernum to UD24.key1. I’m using the OrderHed to try this, but it’s not allowing me to bring in the ud24. Should I go the other way and use ud24 data Directive?

Note:. Trying to limit the ordernum write to OrderHed.ordernum changes from zero to any. This way it should only write new orders.

Thoughts? Ideas?

Normally I’d do something like that in a Method directive, using Preprocessing (on the Update method) to flag that the Order changed (if OrderNum has changed from 0 to Any then set a flag) then in PostProcessing do the actual work.

In PostProcessing, you should be able to reference the UD24 table similar to this: (partial code from a BPM we use for suppliers and UD07)

using (var txScope = IceContext.CreateDefaultTransactionScope())
{
LWvendor = new Ice.Tables.UD07();
LWvendor.Company = Session.CompanyID;
LWvendor.Key1 = “VENDOR”;
LWvendor.Key2 = EPIvendor[“VendorID”].ToString();
Db.UD07.Insert(LWvendor);
txScope.Complete();
}