This post is machine-translated. The original post in german language can be found here.

Register picking list for selected lines of a sales order

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.

Screenshot

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());
}
These post applies to following version:
Dynamics AX 2012

Add comment
 
 

 

 
 
 
Posts of the actual month
April 2024
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930 
 
© 2006-2024 Heinz Schweda | Imprint | Contact | German version | Mobile version
In order to provide you with better service, this site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.