How to get on hand inventory quantity or Available physical quantity of item in D365

Below function returns onhand qty of item. You can further filter on hand qty of the item for a location by passing invent location id as its optional parameter


public InventQtyAvailPhysical onHandQty()

    {

        InventDimParm       inventDimParm;

        InventDim           inventDim;

        Qty                 AvailablePhysical;

        inventDim = InventDim::find(this.InventDimId);//invent dim ID

        inventDimParm.initFromInventDim(InventDim::find(inventDim.inventDimId));

        AvailablePhysical= InventSum::findSum(this.ItemId,inventDim,inventDimParm).availPhysicalCalculated();

        return AvailablePhysical;

    }


// (or)


InventOnhand InventOnhand;

InventOnhand = InventOnhand::newItemId("ItemId");

InventOnhand.parmInventDimId("InventDimId");

InventOnhand.availPhysical();


Comments

  1. Thanks for Sharing such an amazing article. Keep working... Your Site is very nice, and it's very helping us.. this post is unique and interesting, thank you for sharing this awesome information

    PM Employment Generation Programme Scheme | PMEGP

    ReplyDelete

Post a Comment

Popular posts from this blog

SSRS Report using Controller , Contract and RDP classes in D365

Exporting data to Excel through X++ code

COC for Form level method

How to pass the parameter from one form to another in Dynamic365

Multi Select Lookup in SSRS Report in D365