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

Linking Parent and Child Grids on a form

(0) ShareShare
ReportReport
Posted on by

The Parent Grid is based on the purchase table and the Child Grid is based on vendinvoiceTrans

It's linked the the PurchID but the child grid show all the related records.

What am I doing wrong?

Thanks

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,126 Super User 2026 Season 1 on at

    Hi Brianmaric,

    Can you describe what you mean with "but the child grid show all the related records"? Do you mean to say, you see all VendInvoiceTrans records despite a correct link between these tables? Can you share how you defined the join relation on the form data sources?

  • brianmaric Profile Picture
    on at

    Yes that is what I meant.  I see all the related records despite a correct link (PurchId)

    2313.PurchTable.PNGVendInvoiceTrans.PNG

    btw, the adding the following code to executeQuery method of VendInvoiceTrans seems to do the trick..

     public void executeQuery()
            {
                QueryBuildDataSource qbds;
                QueryBuildRange qbr;
    
                MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
                selectionHelper.parmDataSource(PurchTable_ds);
    
                QueryBuildDataSource VendInvoiceTransQbds = VendInvoiceTrans_ds.queryBuildDataSource();
    
                PurchTable purchTablelocal = selectionHelper.getFirst();
                while (purchTablelocal)
                {
                    VendInvoiceTransQbds.addRange(fieldNum(VendInvoiceTrans, PurchId)).value(queryValue(purchTablelocal.Purchid));
                    purchTablelocal = selectionHelper.getNext();
                }
    
                super();
            }

     I'm wondering if this is the best way to do this..

  • Verified answer
    Martin Dráb Profile Picture
    238,740 Most Valuable Professional on at

    Does VendinvoiceTrans have a relation to PurchTable? If not, the system doesn§t know how to create the link. You would need to either add a relation in AOT or use addLink() when intializing the form.

    But if you want transactions for several selected orders, you incdeed need to do it in code.

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
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 349

#3
Diego Mancassola Profile Picture

Diego Mancassola 263

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans