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
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.
Yes that is what I meant. I see all the related records despite a correct link (PurchId)
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..
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?
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156