E10 - Data Directive - multiple iterations

I have a “Execute Custom” setup under the In-Transaction of OrderHed and anything I place in the “Execute Custom” block runs 6 times.

Currently I have:
var ttHed = (from row in ttOrderHed select row).Single();
ttHed.OrderComment = ttHed.OrderComment + " =";

I end up with:
= = = = = =

If I use a “Set Field” block, then I only get one iteration. Unfortunately I need the Execute Custom as I need to pull data from a ShipTo.Character01 field by customer.

one common problem with Data directives is that they DO run every time that the data is modified… what you need to do is add a condition at the beginning that filters out when your C# block is actually run. like “if part number changes from any to any” then run, or something that filters out why you are re-running the C# block.

1 Like