Hi,
I have a form with two datasources. I want to filter the form based on the child datasource field.
How to write execute query to filter the form. Here I have used one combobox control for filter. Help me on this.
Regards,
Ram
Hi Ram,
Please check the old thread:
community.dynamics.com/.../join-form-data-sources-by-code-in-x
How are the data sources joined or linked?
If they're linked (e.g. with a Delayed link), you can't filter the parent data source by applying a filter to the child data source, because they're in two separate queries. You'll need to add one more data source (for the child table) joined to the parent data source and filter this data source.
Hi Martin,
Yes they both are linked. type::innerjoin they both have relation on accountno. Only two tables have this relation. Could you please provide some code samples ?
If the type is InnerJoin, they're joined, not linked. They form a single query and applying a range to either data source will impact the query.
You can add a range by something like this:
SysQuery::findOrCreateRange(MyTable_ds, fieldNum(MyTable, MyField)).value(...);
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 Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 1,882
André Arnaud de Cal... 794 Super User 2025 Season 2
Sohaib Cheema 525 User Group Leader