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

Notifications

Announcements

No record found.

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
    301,075 Super User 2025 Season 2 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
    237,965 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans