Tuesday, July 23, 2019

How to get cost price of an Item based on Warehouse X++

public  real  GetCostPrice(ItemId _itemId, InventLocationId _inventLocationId)
    {
        InventDimParm inventDimParm;
        InventOnHand inventOnHand;
        InventSum inventSum;
        InventDim inventDim;
        ;

        select firstOnly1 inventSum where inventSum.ItemId == _itemId;
       
        //inventDim.InventSiteId = "SiteId";
        inventDim.InventLocationId = _inventLocationId;
        inventDimParm.initFromInventDim(inventDim);
        inventOnHand = InventOnHand::newItemDim(inventSum.ItemId, inventDim, inventDimParm);
        return inventOnHand.costPricePcs();
       // info(strfmt("%1", inventOnHand.costPricePcs()));
    }

Thanks
Uma

No comments:

Post a Comment

Get Enum Id and Enum Value in D365FO using SQL and X++

 Below is the sql get enum id and enum value of a enum in D365 F&O using sql. SELECT   enumidtable . NAME           'Enum Name' ...