Requirements: If the OrderHed.HDCaseNum field of the added row is greater than the 1 expression THEN default (set) the OrderRel.WarehouseCode field to the RMA warehouse.
Problem: when i try to do an “in transaction” data directive, i choose the orderhed table but im not able to see the order rel fields etc.
Does this need to be done via ABL?
Any help would be much appreciated.
In E9, we found that data directives slowed the processing speed significantly and went with method directives where able, as they seemed to run much more efficiently.
That said, could you use the Sales Order update method? I would think post processing would do it.
Releases get added behind the scenes, so i don’t think you will see the Add happen. Is the case being added to the sales order or is the sales order being made from the case?
If the case number is being added you can use case has been changed from any to any to enable a post processing directive and use the abl code below.
Greg
For Each ttOrderHed,
Each OrderDtl fields( OrderNum ) where OrderDtl.OrderNum = ttOrderHed.OrderNum and OrderDtl.Company = ttOrderHed.Company and OrderDtl.OrderLine = OrderDtl.OrderLine,
Each OrderRel fields( WareHouseCode ) where OrderRel.OrderNum = ttOrderHed.OrderNum and OrderRel.Company = ttOrderHed.Company and OrderRel.OrderLine = OrderRel.OrderLine
and OrderRel.OrderRelNum = OrderRel.OrderRelNum.
Assign OrderRel.WarehouseCode = "RMA".
End.
So the first step is to trace the order being created and see what methods are being used.
First put an info message on it to be sure it is firing. You can waste a lot of time debugging code that never will work.
Once you know that method is firing then we can work on the setting of the fields with abl code.
Greg is spot on with recommending to do this in abl. using the built in method directive gui isnt gonna give you what you want. Greg’s code is the most efficient way to do what you want to do.
Firstly, i thought to try the below (with no conditions, just to see if it’d work) but sadly it didn’t.
I started with added row, then moved it to updated row and then changed row but none made any difference. Even selecting all rows didn’t force it.
Just to confirm - this data directive notification works for only orders created from a case (which is what i need)…It doesn’t work when you just go to order entry and create a new order, which is good.
This is an indication that the CONDITION applied works.
Maybe you don’t have the tt version of the OrderHed at this point in time? I would try using the orderhed table without the tt, but you might need to get the right orderhed record via the order number to do the inequality,
To go off of what Nancy said, you can generally find what your available temporary tables are by performing the following steps:
In the Method/Data Directive, add a Pre-Processing/Standard record.
Add the “The specified field of the changed row…” condition.
Select the “Specified” field followed by the “Table” field in the popup box. From here it should list all of your available temporary tables to access at the time of this Data/Method Directive.
Note: Since you should most likely be utilizing the “OrderHed” instead of “ttOrderHed” table, I would make sure to try it on both the “Standard” and “In-Transaction” options (assuming that you are sticking with a Data Directive instead of a Method Directive) if your first choice doesn’t work.