Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to get the active record from a grid to another grid

Posted on by 434

Hi ,

I am new to AX 2012 . I am having one Form and there i have 2 Grid controls. In First grid i have Item Group. In the second grid i have fields like ItemNo, and Product name. If i select one Item Group in first grid , the second grid should be populated with the ItemNo and Product Name  which is assigned with that Item Group.  Help me on this. 

Regards,

Ram.

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,089 on at
    RE: How to get the active record from a grid to another grid

    Hi Ram,

    Please note, that for inventitemgroupitem table SaveDataPerComapny property is set to No and you need add range by current company from X++ for field inventitemgroupitem.ItemDataAreaId.

  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    RE: How to get the active record from a grid to another grid

    Hi Nikolaos,

    Here is my form screenshot. The Inventitemgroupitem has duplicate records , I have joined the Inventtable with Inventitemgroupitem table with inner join 

    4885.Screenshot_5F00_4.png

    Regards,

    Ram

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get the active record from a grid to another grid

    Can you share a screenshot?

    Could you please also describe as much details about your form as possible. Do you now have three data sources?

  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    RE: How to get the active record from a grid to another grid

    Hi Nikolaos,

    It worked but there are duplicate records. I have joined Inventtable with inventitemgroupitem link type inner join.

    Regards,

    Ram

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get the active record from a grid to another grid

    You need to join it with InventItemGroupItem - there is no relation between InventTable and InventItemGroup. 

  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    RE: How to get the active record from a grid to another grid

    Hi Nikolaos,

    I Joined the Inventtable with the Inventitemgroup table as you have said but it doesnt work. 

    Regards,

    Ram

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get the active record from a grid to another grid

    If it's a data source on the same form, just join it to the second data source. Exactly the same logic than with the first two data sources.

  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    RE: How to get the active record from a grid to another grid

    Hi Nikolaos,

    If i have to set the range in Invent Table how to set the querybuildrangevalue in Invent Table because there is no Itemgroupid field in InventTable.

    Regards,

    Ram

  • Ram Kumar Profile Picture
    Ram Kumar 434 on at
    RE: How to get the active record from a grid to another grid

    Hi Nikolaos,

    I  tried what you have said, It works .

    Thanks & Regards,

    Ram

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get the active record from a grid to another grid

    Ahh, so your data sources are InventItemGroup and InventItemGroupItem! I thought that they are InventItemGroup and InventTable.

    In this case you don't need any x++ code to achieve the filtering.

    Just set JoinSource of InventItemGroupItem data source to point in InventItemGroup data source, and try to set Link type to Delayed. Does it work?

    Whenever you have two tables that are directly related to each other, you don't need any x++ development to handle the filtering.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans