2017-03-31

[AX2012] Minimum On-hand on On-hand Form

Put display method in InventSum datasource:
\Forms\InventOnhandItem\Data Sources\InventSum\Methods\inventOnHandMin

display public InventQtyMinOnhand inventOnHandMin(InventSum _inventSum)
{
    InventDim       joinDim, dimValues;
    InventDimParm   dimParm;
    ReqItemTable    reqItemTable;

    dimValues.data(_inventSum.joinChild());
    dimParm.initFromInventDim(dimValues);

    select sum(MinInventOnhand) from reqItemTable where reqItemTable.ItemId == _inventSum.ItemId
        #InventDimExistsJoin(reqItemTable.CovInventDimId, joinDim, dimValues, dimParm);

    return reqItemTable.MinInventOnhand;
}

Then put this method in overview grid.