Hi, in this case you have to modify the quantity in your WMSOrderTrans-Record before calling WMSPickingRoute::finishMulti().
There are several ways to do this, the following code worked for me:
static void pickingListRegistration(Args _args) { WMSPickingRouteID pickingRouteID = 00061 // Route id to be picked InventTransId inventTransId = "000015303"; // LOT ID Qty pickQty = 14; // Quantity to pick List list = new List(Types::String); WmsOrderTrans wmsOrderTrans; WmsOrderTrans wmsOrderTransNew; list.addEnd(pickingRouteID); // Change quantity 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; WMSPickingRoute::finishMulti(list.pack()); // Note - this is not in a single tts, so some routes might be posted and others fail wmsDeliverPickedItems::checkDeliverPickedItems(pickingRouteID, list.pack()); }
Hope this helps,
Heinz