Tuesday, October 12, 2010

RegisterPickList from x++ code

static void RegisterPickList(Args _args)
{

//Transfer Order Shipment

InventDim _InventDim;
WmsOrdertrans _WmsOrdertrans;
WmsPickingRoute _WmsPickingRoute;
Map selectedLines = new Map(Types::Int64,Types::Container);

_InventDim.inventSiteId = "NAR";
_inventDim.inventBatchId = "000000428";
_inventDim.InventLocationId = "NARS1";
_inventDim.WmsLocationId = "Silo105";

_inventDim = InventDim::findOrCreate(_inventDim);

ttsbegin;

SELECT FORUPDATE _WmsOrdertrans WHERE _WmsOrdertrans.inventTransId == "000003231"
JOIN _WmsPickingRoute WHERE _WmsPickingRoute.pickingRouteID == _WmsOrdertrans.routeId;
//We have more available on line than needed

_WmsOrdertrans.qty = 1;
_wmsOrderTrans.inventDimId = _inventDim.inventDimId;
_WmsOrdertrans.update();

_WmsOrdertrans.qty = 9;
_wmsOrderTrans.inventDimId = _inventDim.inventDimId;
_WmsOrdertrans.update();
selectedLines.insert(_WmsOrdertrans.RecId,[_WmsOrdertrans.OrderId,_WmsOrdertrans.RecVersion]);

ttscommit;
WMSOrderTransType::finishPickingLinesMulti(selectedLines.pack(),_WMSPickingRoute.CurrentPickPalletId,_WMSPickingRoute.Operator);
}

No comments: