Tag Archives: CLOSING AND ADJUSTMENT USING X++

D365 FO – Closing and adjustment using X++/InventAdj

Requirement – Closing and adjustment – Revaluation for moving average using X++

Sample Code –

static void Job258(Args _args)
{
    InventDataAdjSumUp  dataAdjSumUp;
    InventDimParm       inventDimParm;
    InventClosing       inventClosing;
    InventAdj_SumUp     inventAdj_SumUp;
    TmpFormLookUp       tmpTbl;
    AcxInventRevalueTable acxInventRevalueTable;
    boolean             adjustClosing;

    tmpTbl.clear();
    tmpTbl.initValue();
    tmpTbl.itemId =  itemId;
    tmpTbl.InventDimId = InventDimId;
    tmpTbl.qty = qty;
    tmpTbl.postedValue = postedValue;
    tmpTbl.adjustNow = adjustNow;
    tmpTbl.LineNo = LineNo;
    tmpTbl.insert();
    
    dataAdjSumUp  = InventDataAdjSumUp::newFromForm(tmpTbl);

    inventAdj_SumUp = InventAdj_SumUp::newSumUp(dataAdjSumUp.pack(),inventDimParm
        , today(), false
        // <GEERU>
        ,InventTransCurrency_RU::PrimaryCur
        // </GEERU>
    );

    inventAdj_SumUp.run();
}