Saturday, October 22, 2022

D365 find Invent On Hand Value with X++

 D365 How to find Invent On Hand Value with X++ ?


To show on hand through D365 you can use On-hand list form from Inventory management >> Inquiries and Reports >> On-hand list



You can use Filter for your Item , and show Dimensions for more details 


Here You can check available Physical inventory qty, Available physical qty, Physical reserved qty ,Available physical on exact dimensions qty and Ordered in total qty



To get On-hand for item please find below the X++ code 
you can change parameters based on your business need 




 InventOnhand _InventOnhand;
        InventDimParm _InventDimParm;
        InventDim _InventDim;
        ItemId  itemid = "1030249-0174";

        _InventDim = null;
        _InventDim.InventSiteId  = "Main";
        _InventDim.InventLocationId = "X1";
        _InventDim.wMSLocationId = "ONM-ABQ-01";

        _InventDimParm.initFromInventDim(_InventDim);
        _InventOnhand = InventOnhand::newParameters(itemid , _InventDim , _InventDimParm);
        Info(strFmt("%1 , %2 , %3 , %4 : %5 " , 
            itemid ,  _InventDim.InventSiteId ,  _InventDim.InventLocationId , _InventDim.wMSLocationId
            , _InventOnhand.availPhysical()));



please find below the calculation for  _InventOnhand.availPhysical() 






































No comments:

Post a Comment