web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to retrieve item's average cost price?

(1) ShareShare
ReportReport
Posted on by 1,087

Hi,

I need to get the COST PRICE it is showing in OH HAND screen for an item.

I need to join InventDim table and InventSum table, to get specific Inventory Dimensions for that item.

 

I noticed an 'averagecostPriceUnit' method in InventSum table, but i don't know how to use it

inside a query.

 

My starting query is something like:

 

select * from inventSum join inventDim where inventSum.inventDimId == invendDim.inventDimId

&& inventSum.itemId == _myItemId

&& inventDim.inventLocationId == _myInventLocationId

&& inventDim.inventSiteId == _myInventSiteId;

 

How do i retrieve the averageCostPrice for my item?

 

Thank you in advance

regards 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    vv1984 Profile Picture
    1,087 on at

    Solved:

    You have to use InventOnHand class, InventDimParm and InventDim of course:

    You use a temporary InventDim table to specify which inventory dimensions you want to filter in your query.

    Then you initialize a InventDimParm object with InventDim as a parameter.

    You finally pass InventDimParm to InventOnHand and there you are, you just need to specify your ItemId:

    InventOnHand.parmItemId(_myItemId);

    I can post a full working job example if someone's interested.

    Thank you

    regards

  • dolee Profile Picture
    11,279 on at

    Try InventSum.'averageCostPrice' method as well?

  • vv1984 Profile Picture
    1,087 on at

    I was not able to use it because I didn't know the InventDimId from the start, but only some parameters:

    site, warehouse and variation.

    I needed to group the averageCostPrice by these parameters, and so i think that was the only way to achieve it.

  • Srinivasan Pandiaraj Profile Picture
    30 on at

    Dear friend,

    please post full working job for retrieve item's avg cost price . I am in need of it .

    Please help me.

    Thanks in advance.

  • Community Member Profile Picture
    on at

    Yes. Please post a full working job if you could.

    That would be wonderful.

    Thanks

  • Pradeep Itnal Profile Picture
    3,248 on at

    Do you still have the code for it? could you please reply here

  • waseem osman Profile Picture
    40 on at

    Dear VV,

    Please mail me full working job.

    Thank you,

    Regards

  • Community Member Profile Picture
    on at

    Can anyone please mail me a working job?

  • Nadeem Bhatti Profile Picture
    2,055 on at

    I also need the avg price of item on given date, if some can provide me.

  • Pradeep Itnal Profile Picture
    3,248 on at

    Take a look at inventSum table, i guess there is a method.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans