Hello,
I have written code to automatically register the inventory lines on a return order. When I do this process functionally through the UI, I go to the line, and hit Update line> registration. Then when I go through that whole process the line status turns to Registered and the Receipt status turns to registered. Additionally, the button to Post packing slip is activated.
When I try to accomplish this same thing in code, the Receipt status on the line turns to registered, but the line status stays as Open, and the packing slip button is still disabled. This is the code I'm using, and it works perfectly for registering sales lines. Does anyone have any experience registering return order lines so that the status changes and I can proceed with posting the packing slip?
InventTrans inventTrans;
InventDim inventDim;
InventMovement movement = InventMovement::construct(_salesLine);
InventUpd_Registered registered;
InventDimParm dimParm;
inventTrans = InventTrans::findTransId(_salesLine.InventTransId);
inventDim = InventDim::find(_returnsTmp.inventDimId);
dimParm.initFromInventDim(InventDim);
registered = InventUpd_Registered::newParameters(movement, InventDim, dimParm, InventDim, dimParm, _returnsTmp.ReturnQuantity);
registered.updateNow();

Report
All responses (
Answers (