Skip to main content



No record found.

Microsoft Dynamics AX forum
Suggested answer

How To get inventory cost as of date

Posted on by 5

Hi all i use Dynamics AX 2012 R3 and right now i get some issue because i can get the item cost backdated. 

i try to get from inventory value report summary but in this report i just can get the cost for the item that still have stock on system, but if there is some item that already don't have the stock but in that month we have transaction for that item, i can't get the item cost. can any one help me to get this with X++ code or there is some class i can used?

i try to used this job before but still can't

static void SL_FindItemCostPriceAsPerDate(Args _args)


   InventDim           inventDimCriteria;

   ItemId                 itemId;

   InventDimParm  inventDimParm;

   date                    perDate = mkDate(28,3,2016);

   InventOnHand    inventOnHand;


   itemId                 = '010100002';

   inventDimCriteria.inventBatchId = '123456';


   inventOnHand    = InventOnhand::newParameters(itemId, inventDimCriteria, inventDimParm);

   info(strfmt('%1', inventOnHand.costPricePcs(false, perDate)));


i try to used this but there is always 0

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: How To get inventory cost as of date


    The inventory value report has multiple configuration options available.

    If you are for example interested in the costs of the items that have been sold then enable to COGS parameter or if you want to have some information on adjustment postings then select the profit and loss parameter.

    Doing that allows you the costs of items that might not even be on stock as of today but for which you had costs over the last month/week/etc.

    Best regards,


Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans