Setting OrderHed/Rel ShipVIACode on EDI Import

,

I want to override the default ShipVIACode for all OrderHed/OrderRel lines created when EDI orders are imported. I want to instead set it to the ShipVIACode found in the ShipTo table for the specific customer/ship to the order is for.

I am having a very difficult time finding the correct method (literally and figuratively). The orderes created on EDI import do not use the same BOs that a manually created order uses and tracing is proving difficult.

I would prefer to do this widgets and not custom code but whatever.

You could probably use a Data Directive on something like that. If you can get a criteria to isolate those orders (maybe EntryPerson?), you could add a data tag on an In-Tran Data Directive, then use a standard Data Directive on OrderHed along the lines of these widgets:

  1. On OrderHed, if the record has the data tag
  2. Call the SalesOrderSvc BO to change the ShipVia
  3. Remove the Data Tag

If you’re on a version with Epicor Functions, I’d probably move that second stage to a function, and invoke the function from the BPM.

This is my goto post for edi data fixing.

If you look at the chart there you can fix the shipvia before it gets to demand entry with a base directive on ImportEDIb4Val. I made one in widgets for this. Two variables, CustNum and ShipTo

image

expression for shipto


expression for custnum
image
image
expression for set field

Db.ShipTo.Where(w => w.CustNum == CustNum && w.ShipToNum == ShipTo).Select(s => s.ShipViaCode).FirstOrDefault()
1 Like

Perfect, thank you.

1 Like