Register a sales order line or any other inventory transaction

public void registerTransaction()
{
    InventTrans             inventTrans;
    InventDim               inventDim;
    InventTransWMS_Register inventTransWMS_register;
    TmpInventTransWMS       tmpInventTransWMS;

    inventTrans = InventTrans::findTransId(salesLine.InventTransId);
    if(inventTrans && inventTrans.StatusReceipt != StatusReceipt::Registered)
    {
        inventDim   = inventTrans.inventDim();
        tmpInventTransWMS.clear();
        tmpInventTransWMS.initFromInventTrans(inventTrans);
        tmpInventTransWMS.InventQty     = inventTrans.Qty;
        tmpInventTransWMS.InventDimId   = inventDim.inventDimId;
        tmpInventTransWMS.insert();

        inventTransWMS_register = inventTransWMS_register::newStandard(tmpInventTransWMS);
        inventTransWMS_Register.createFromInventTrans(inventTrans, inventDim);
        inventTransWMS_register.writeTmpInventTransWMS(tmpInventTransWMS, inventTrans, inventDim);
        inventTransWMS_register.updateInvent(inventTrans);
    }
}

 

Search

About

DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics AX.

Authors are allowed to set their own AdSense units.
Join us.

Blog Tags