First question - Why Iterate?
We want to check all OrderRels, and show the shape if one or more have a missing ReqDate, so need to iterate to check all rows.
Assuming you have all the OrderRels may be both correct and incorrect at the same time, and the iteration is occurring as expected, but there is only one row available to us. See below:
Use Dev Tools to check, F12, console, epDebug.setDebugStatus(true), epDebug.views
When I open Order Entry, on an order with Line 1, release 1, Line 2, Releases 1 and 2, in the OrderRel DataView I only see line1/rel1. I do not see Line2/Rel1 or Line2/Rel2.
OrderEntry is making a GetByID call, pulling in the full OrderHead/Line/Rel DataSet, however is doing some in-memory filtering, so this is why OrderRel is not available when you look at epDebug.views.
If you look at the set up of the DataView in Dev Tools, it is set up parent/child, so since the PO loads the header, and line 1, you only see the releases associated to line 1 (even though they are loaded in memory, just filtered out):
So, let’s not try to use the out of box DataView at all, as we don’t want to make any changes there, which would likely break the set up of Order Entry.
Instead, let’s make a new dataview, call it “MyOrderRel” or similar. The only thing you should change from default us to uncheck the “Dirty Rows” checkbox, and give it a name.
Now, in your AfterGetByID, lets pull the data we want into that DataView.
Set up a kinetic-rest component, call Erp.BO.SalesOrderSvc/GetByID.
For parameter orderNum - {OrderHed.OrderNum}
In Kinetic REST Arguments - check “Process REST Response” box.
“Parse from Response Path” should be ‘returnObj’ - we know this because if we check REST API Help, Erp.BO.SalesOrderSvc - GetByID, “Try it out”, fill out the API Key, Company, and OrderNum, and Execute - we can see the response comes in the “returnObj” object:
in response parameters of your kinetic-rest component: (do not click DataSet button, if you do, delete the whole component and start over, this will cause a bug.)
Parameter Name: OrderRel
View Name: MyOrderRel
Merge Behavior: replace
now, your orderrel dataview will have the data you expect in it. Change the previous set up that walked through OrderRel/matches to instead walk through MyOrderRel/matches.