Friday, December 30, 2016

Get Lastest Purchase price of an item ax 2012

private Price GetLatestPurchPrice(ItemId _item)
{
    InventItemPrice invItemprice;
    ;
    select firstOnly invItemprice order by RecId desc
        where invItemprice.ItemId == _item
            && invItemprice.PriceType == CostingVersionPriceType::Purch
                && invItemprice.CostingType == InventItemCostingType::Last;
   
    return  invItemprice.Price;
}

No comments:

Post a Comment

validateExistCommonRecord in D365FO X++

validateExistCommonRecord(     RefTableId _refTableId,     RefRecId _refRecId) {     boolean ret = true;     if (!_refTableId || !_refRecId)...