We have default warehouse locations for each inventLocation. This default must be shown in the wmsLocationId of InventDim on WMSPickingRegistration.
So in grid: PickLinesGrid, each WMSOrderTrans is linked to an InventDim record and the wmsLocationId is displayed for each line. I need to default the default warehouse in here. But for the live of me I can't get it to show.
If I put the logic on selectionchanged of WMSOrderTrans it will default for the line the cursor is on. But that means the user has to click on each line for the default to show. We want it shown the moment the grid loads.
Adding the logic to the Form's Init-method postHandler, I use the switch statement to determine the ID to use and the inventTransType where applicable. Then I use while loop to go through all the wmsOrderTrans records that are in this case, linked to the salesTable that is passed in with args().
Then I find the inventDim linked to wmsOrderTrans, use its inventLocationId to lookup the default warehouse and assign it to wmsLocationId. I can afterwards see that the inventDim has the value assigned to the field wmsLocationID. It is just a default for the grid, so I don't want to save it permanently. The user will decide if that location should stay or if they want to change it in the grid before confirmation of the pickline registration.
However when the lines are shown in the grid, the column is blank. So, do I miss a refresh and if so, where do I put it? I have tried it on the OnQueryExecuted method of wmsOrderTrans, but nothing.
If it looses the value between the Init-method of the form and the executeQuery of inventDim, where should I put it that it assigns it for each line in the grid.
Any suggestions is much appreciated.