This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The code example below shows how code can be used to register a picking list and process only partial quantities.
My approach is to create a separate line in the WMSOrderTrans table for the required quantity (using the Split function) and to cancel the currently not needed quantity.
static void pickingListRegistrationPartly(Args _args) { WMSPickingRouteID pickingRouteID = "00066"; // Route id to be picked Map inventTransMap = new Map(Types::String, Types::Real); MapEnumerator me; InventTransId inventTransId; Qty pickQty; List list = new List(Types::String); WmsOrderTrans wmsOrderTrans; WmsOrderTrans wmsOrderTransNew; list.addEnd(pickingRouteID); // Build map containing the lot-ids and quantity to pick inventTransMap.insert("014023", 7); inventTransMap.insert("014026", 3); // Change quantity me = inventTransMap.getEnumerator(); while (me.moveNext()) { inventTransId = me.currentKey(); pickQty = me.currentValue(); ttsBegin; select forupdate wmsOrderTrans where wmsOrderTrans.RouteId == pickingRouteID && wmsOrderTrans.inventTransId == inventTransId && wmsOrderTrans.FullPallet == NoYes::No && (wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Registered || wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Activated || wmsOrderTrans.ExpeditionStatus == WMSExpeditionStatus::Started); // Split line wmsOrderTransNew = wmsOrderTrans.split(pickQty); ttsCommit; ttsBegin; // Cancel remaining line wmsOrderTrans.cancel(); ttsCommit; } // Update WMSPickingRoute::finishMulti(list.pack()); wmsDeliverPickedItems::checkDeliverPickedItems(pickingRouteID, list.pack()); }