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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How the UnitID and the ItemID Related

(0) ShareShare
ReportReport
Posted on by 456

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.

UnitID.PNG

Thanks & Regards

Ram.

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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?

  • Ram Kumar Profile Picture
    456 on at

    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,

    Ram.  

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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).

  • Ram Kumar Profile Picture
    456 on at

    Hi Nikolaos,

    I have tried this here is my code ,

    8508.purch.PNG

    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). 

    Thanks & Regards,

    Ram.

  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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.

  • Ram Kumar Profile Picture
    456 on at

    Hi Nikolaos,

    Sorry for the Mistake , My requirement is purchase Unit. shall i use Display method for the unit field instead of joining Datasources.  

    Thanks & Regards,

    Ram.

  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 659

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 465 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 304 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans