Hello.
I am having problem completing Work on WHS (storage). I have salesOrder that have this work with two lines:
Two lines of work has sttaus Opened. Then I executing this code on X
ttsBegin; select workTable where workTable.OrderNum==salesTable.SalesId; info("workTable=" workTable.WorkBuildId); manualComplete = new WHSWorkManualComplete(); while select forUpdate workLine where workLine.WorkId == workTable.WorkId && workLine.WorkStatus == WHSWorkStatus::Open { workLine.WorkStop = true; workLine.update(); } setWorkHeaders.add(workTable); workCompleteForm.initFromSet(setWorkHeaders, tmpCompleteWorkTable, tmpCompleteWorkLine, true); while select tmpCompleteWorkLine { info("tmpCompleteWorkLine **" int642str(tmpCompleteWorkLine.RecId)); } if (manualComplete.validateWork(workTable.WorkCreatedBy, tmpCompleteWorkTable, tmpCompleteWorkLine)) { info("Validated work"); while select forUpdate tmpCompleteWorkLine { info("tmpCompleteWorkLine **"); } while select tmpCompleteWorkTable { manualComplete.executeWork(workTable.WorkCreatedBy, tmpCompleteWorkTable, tmpCompleteWorkLine); info("** manualComplete.executeWork ** "); } } delete_from tmpCompleteWorkTable; ttsCommit; info("Completado trabajo");
I executing this code and this is what I got:
This is how WHS work looks like now:
As you can see only first line is Closed, and second has same status Opened. I need to both lines to be Closed.
Can anyone help me with my X code, is anything incorrect?
Thanks.