Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2023 Release Wave 1Check out the latest updates and new features of Dynamics 365 released from April 2023 through September 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | All TechTalks | Architecture Insights
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
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:
I can post a full working job example if someone's interested.
Try InventSum.'averageCostPrice' method as well?
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.
please post full working job for retrieve item's avg cost price . I am in need of it .
Please help me.
Thanks in advance.
Yes. Please post a full working job if you could.
That would be wonderful.
Do you still have the code for it? could you please reply here
Please mail me full working job.
Can anyone please mail me a working job?
I also need the avg price of item on given date, if some can provide me.
Take a look at inventSum table, i guess there is a method.
I need this job, can you please post for me.
Please post a full working job example.
// try this, hope it helps
static void SL_FindItemCostPriceAsPerDate(Args _args)
date perDate = mkDate(28,3,2016);
itemId = '010100002';
inventDimCriteria.inventBatchId = '123456';
inventOnHand = InventOnhand::newParameters(itemId, inventDimCriteria, inventDimParm);
info(strfmt('%1', inventOnHand.costPricePcs(false, perDate)));
Did anyone find solution? I want same code :)
Anyways my requirement is to get all records in temporary table and I am trying to achieve by below code but problem is logic in InventSum_AverageCostPriceUnit method is complex. I tried to copy same logic but not able to get any results.
If Item has 6 transactions then InventSum table is displaying many values don't know how.
I will try Omer's code but he is taking lit of parameters. Anyways thanks :) Win32 seems move to different ERP..:D
Code worked for me. As I wanted details on site basis I have added some additional code and pushed all records in temp table.
Thanks a lot!!
Business Applications communities