Description:-
In this article we will see about how to select item and it’s configuration through code and directly update invent quantity. Here I have create form where you can select items through code and directly update it in inventory while sales order picking list posting.


Now code on your created
button for open new form and in DataSource init select items and serial number
from RAF posted Journal. After selecting multiple records update inventory
through given code.
//pick or unpick inventTransQuery = new Query(); QueryBuildDataSource = inventTransQuery.addDataSource(tableNum(InventTrans)); InventTrans = InventTrans::findTransId(conInventTransId); InventTransOrigin = InventTransorigin::findByInventTransId(conInventTransId); QueryBuildDataSource.addRange(fieldNum(InventTrans,RecId)).value(int642str(InventTrans.recid)); delete_from tmpInventTransWMS; tmpInventTransWMS.clear(); inventTransWMS_Pick = InventTransWMS_Pick::newStandard(tmpInventTransWMS,inventTransQuery); tmpInventTransWMS.initFromInventTrans(InventTrans); tmpInventTransWMS.initFromInventTransOrigin(InventTransOrigin); tmpInventTransWMS.InventQty = -1 * conVariantQty; //minus qty untuk unpick, plus qty untuk pick tmpInventTransWMS.InventDimId = _inventDimX.InventDimId; inventTransWMS_Pick.writeTmpInventTransWMS(tmpInventTransWMS); inventTransWMS_Pick.updateInvent(); //end pick or unpick
Thanks for comments.....