Notifications
Announcements
No record found.
Hi,
I Have created a new Form and I Used many Fields from different datasources . I have to get the unitID of the Item ID I have mentioned, how to achieve this. I am new to ax 2012.
Thanks & Regards
Ram.
What Unit would you like to get? What data is it that you are showing here?
The product and it's transactions might have many different units. For example you might purchase in tons and sell in kilograms. Perhaps you need to talk to the person who defined the requirement for you, and ask which unit should be shown here?
Hi Nikolaos,
For example If we take Resin (Product) its unit is Lbs. I had taken the unit for the Item in Inventtablemodule Table. But by using the joins i have to take the correct Unit for the Itemid. My form shows the incorrect Unitid for the Itemid.
Thanks & Regards,
InventTableModule has three records for every item id: Purchase order, Sales order and Inventory. Which one you want to show? Purch unit, sales unit or inventory unit? Based on that, you need to set the correct join relation (InventTableModule.ModuleType).
I have tried this here is my code ,
I didn't got related unit for the itemid. My Form shows the UnitID which was in the order in Table. I need to get the Related UnitId from Inventdimmodule table which is related to Inventjournaltrans table's (Item Id).
There is no InventDimModule table.
By the way, your code is looking for the Purchase unit, but in InventJournalTrans we handle Inventory unit.
Anyway, you should first determine what exact information you need, before writing any code. Look for the correct information in D365 user interface (with help of a functional consultant who perhaps defined the requirement), and once you find the info, figure out the data model beneath, and finally develop code to fetch the value.
Sorry for the Mistake , My requirement is purchase Unit. shall i use Display method for the unit field instead of joining Datasources.
Yes, of course you can use display method.
However InventJournalTrans quantity is related to inventory unit. So, if purchase unit is something different, your qty might not be correct.
For example, if purchase unit is ton and inventory unit is kg.
And your inventory transaction is 500 kg.
If you now replace "kg" with "t" your form will show wrong data.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader