Pick and unpick Item in Picking list while salesorder pickinglist journal posting in ax 2012

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. 
First create sales order and add multiple or single item in lines. After confirm sales order and create picking list.

From line tabe Select Pick from Updateline Selection. after you can select item or add item’s based on configuration, site and warehouse.  Here I have add button for picking item from Posted Report as Finished journal from Production order, so you can select directly from Production order how many quantity create form Which identification number or else which order. 

In Pick from you can see issue status, sales order number, item number and its configuration, site and warehouse and from which serial number item quantity pick form RAF (Report as Finished) journal. That selected item will be picked and update in inventory transaction like below image. 

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

Related Posts

Previous
Next Post »

Thanks for comments.....