Notifications
Announcements
No record found.
I have a parent form and i have added a action menu button which opens a child form
i want to filter the child form data on the basis of parent form data.
in parent form i have a grid, having multiple rows and each rows having different voucher no, i want to use all the current form voucher no to filter the record on child form
What exactly do you mean by "all the current form voucher no"? All records that meet the criteria of the query in the parent form? For example, if the table has 500 records, the query applies filters that are met by 100 records, 20 of them displayed on screen without scrolling, you want the child form to show data related to those 100 parent records?
i have different journals each journal have different no of records
when i open any 1 journal i have multiple no of records in a grid of the journal and even i can create new records
each record i.e row on a grid have different voucher no.
and on the same form i have action menu button to generate child form .
currently the child form display all the data available on table.
i want only those record should be displayed whose voucher no matches to parent form voucher no
Here a code from Martin. (Don't forget if two table have a relation it will come with range. You must clear that)
MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct(); selectionHelper.parmDataSource(FormDataUtil::getFormDataSource(this.args().record()); QueryBuildDataSource lineQbds = jobLine_ds.queryBuildDataSource(); JobTable jobTable = selectionHelper.getFirst(); while (jobTable) { lineQbds.addRange(fieldNum(JobProjLine, JobId)).value(queryValue(jobTable.JobId)); jobTable = selectionHelper.getNext(); }
And don't use it for too many lines. I couldn't remember clearly but there was a limit for range
i am getting error at
selectionHelper.parmDataSource(FormDataUtil::getFormDataSource(this.args().record());
error FormDataUtil is not a class
Unfortunately you didn't react to what I wrote. And your new text, "whose voucher no matches to parent form voucher no", sounds more like you want records related to a single voucher number. Could you clarify it, please? I can't tell you how you implement your requirement without knowing what the requirement is.
By the way, FormDataUtil class exists in D365FO, not (AFAIK) in AX 2012.
Sorry it seems old ax don't have class but you can get ds from args too (dont forget checkin menuitem)
I don't have ax, so I can't check it 2012 but something like this;
args.record().dataSource()
in my current form there are 5 row's that mean for each row i have different voucher number .
i want when i click on button to open the child form , child form should show the record related to those voucher number which were available on my current form
if i have 5 row's in my current form that means 5 voucher number and the child form should pick all the record related to those 5 voucher from the child form data source and show them on child form .
5 range value is not a problem (I don't remember limit but I think its equal to filter length at the form). If you have only a field for range you dont need loop
MultiSelectionHelper have method for range. You can do like this;
MultiSelectionHelper helper; if (element.args() && element.args().caller() && element.args().record()) { this.query().dataSourceTable(tableNum(form2Table)).clearDynalinks(); helper= MultiSelectionHelper::createFromCaller(element.args().caller()); helper.createQueryRanges(this.query().dataSourceTable(tablenum(Form2Table)), fieldstr(Form2Table, Field2),fieldstr(Form1Table, Field1)); }
I would say that a more intuitive design pattern might be that you select one or many records, then open the second form, and the second form would show records that are related to all the selected parent records (instead of all, potentially tens of thousands of records that the query of the parent form returned).
Usually filtering on child form is based on the selected record on the parent form.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader