Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Two grids, linked together on form

Posted on by 280

Hi all

Running AX 2012 R3 CU9

I've created two tables, linked together by an auto-number sequence. I'll call them in this example XHeader and XLine, with XId tying the lines to the headers.

It's all working on the backend fine, but I'd like to create a form which can display this information in two grids - one grid which shows all the XHeader records, and a second grid which switches context to the XLines attached to that XHeader.

I created this form with the two data sources, and I thought the way to do it would be to modify the active() method to filter based on the current record's Xid. But I can't quite get it to work.

I can't seem to find any documentation for a use case like this, though there are forms like this across AX so I know there is a way of doing it.

Any help would be much appreciated

Cheers

Luke

*This post is locked for comments

  • lukbel Profile Picture
    lukbel 280 on at
    RE: Two grids, linked together on form

    Hi Martin,

    Apologies, I had tested this solution before posting and it hadn't worked.

    But once you confirmed it SHOULD work, I realised what the problem might be.

    Because both the tables were custom-made, the relationship between the two wasn't hardcoded. So it wouldn't filter if I tried above solution. Added relation, compiled and synchronised table, then the form worked as expected.

    Thanks very much for your help :)

    Cheers

    Luke

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: Two grids, linked together on form

    You don't need even a single line of code; just set two properties of XLine datasource: Join Source = XHeader and LinkType = Delayed. And make sure that the first grid it bound to XHeader datasource and the other to XLine datasource.

    You can see it in SalesTable form, for instance.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans