28 April 2017

How to get on hand inventory quantity or Available physical quantity in AX 2012

public InventQty onHandInventory(ItemId itemId, InventSiteId inventSiteId,InventLocationId inventLocation)
{
    InventOnhand    inventOnhand;
    InventDim       _inventDim;
    InventDimParm   inventDimParm;
    InventQty       availQty;
    //inventDim
    _inventDim.InventSiteId = inventSiteId;
    _inventDim.InventLocationId = inventLocation;
    inventDimParm.initFromInventDim(_inventDim);

    inventOnhand = inventOnhand::newParameters(itemId,_inventDim,inventDimParm);

    availQty = inventOnhand.availPhysical();
   // info(strFmt("%1",availQty));
    return availQty;

}

Service class to get the selected record and deleted matching records and refresh the form data source in D365 F&O

 [DataContractAttribute] class ABCUserProfilesBulkDeleteContract {         UserId userId;     [DataMemberAttribute('UserId')]     pu...