Dynamics Search Engine

Sunday, November 28, 2010

How to do Picking list for an invent transfer order through a job using X++ in Dynamics AX

This article explains:
How to picking list through a job using X++ in Dynamics AX.
Applied on:
Dynamics AX 2009 SP1

Create a job as mentioned below:

static void PickingListByCode(Args _args)
{
InventTransferParmTable inventTransferParmTable;
InventTransferMultiPick inventTransferMultiPick = InventTransferMultiPick::construct();

;
InventTransferParmTable.TransferId = "transferid" //Provide transferId
inventTransferParmTable.EditLines = true;
inventTransferParmTable.AutoReceiveQty = true;
inventTransferParmTable.UpdateType = InventTransferUpdateType::PickingList;
inventTransferParmTable.PickUpdateQty =InventTransferPickUpdateQty::All ;
inventTransferMultiPick.runUpdate(InventTransferParmTable);

}

NOTE: Use at your own risk. There is no warranty on this article.

How to create an invent transfer order through X++ code in Dynamics AX

This article explains:
How to create an Invent Transfer Order through a job using X++ code.

Applied on:
Dynamics AX 2009 SP1

Create a job as mentioned below:

static void CreateTransferOrderLine(Args _args)
{

    InventTransferTable inventTransFerTable;
    InventTransferLine inventTransFerLine;
    InventTable inventTable;
    NumberSeq numberSeq;
;

    numberSeq = NumberSeq::newGetNumFromCode(Inventparameters::numRefTransferId().NumberSequence);
    inventTransferTable.TransferId = NumberSeq.num();
    inventTransferTable.InventLocationIdFrom = "FromLocation";
    inventTransferTable.InventLocationIdTo = "ToLocation";
    inventTransferTable.initFromAddress();
    inventTransferTable.initValue();
    inventTransferTable.initDeliveryMode();
    inventTransferTable.initToAddress();
    inventTransferTable.insert();
    inventTransferLine.clear();

    inventTransferLine.initFromInventTransferTable(inventTransferTable,NoYes::Yes);
    inventTransferLine.ItemId = "ItemId";
    inventTransFerLine.LineNum = InventTransferLine::lastLineNum(inventTransferTable.TransferId) + 1;
    inventTable = InventTable::find(InventTransferLine.ItemId);
    inventTransferLine.initFromInventTable(InventTable);
    inventTransferLine.QtyTransfer = 1.0;
inventTransferLine.QtyRemainReceive = 1.0;
    inventTransferLine.QtyRemainShip = 1.0;
    inventTransferLine.insert();
}



NOTE: Use at your own risk. There is no warranty on this article.