How to get available physical for an Item and for Warehouse in AX 2012 / D365 FO
InventDimParm invDimParm;
InventDim invDim;
Qty availPhys;
invDim.InventLocationId = 'INVENTLOCATIONID';
invDim = InventDim::findOrCreate(invDim);
invDimParm.initFromInventDim(InventDim::find(invDim.inventDimId));
availPhys = InventSum::findSum("ITEMID",invDim,invDimParm).availPhysical();
info(strfmt("availPhys:%1 ",availPhys));
========
InventDim inventDim;
InventDimParm inventDimParm;
InventOnhand inventOnhand;
inventDim.InventLocationId = 'Yourwarehouse';
inventDimParm.initFromInventDim(inventDim);
inventOnhand = InventOnhand::newParameters('Youritem', inventDim, inventDimParm);
info(strfmt("Available Physical: %1", inventOnhand.availPhysical()));
No comments:
Post a Comment
Give me the commetns and solutions