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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to filter form using child data source field

(0) ShareShare
ReportReport
Posted on by 454

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

I have the same question (0)
  • WillWU Profile Picture
    22,361 on at
    RE: How to filter form using child data source field

    Hi Ram,

    Please check the old thread:

    community.dynamics.com/.../join-form-data-sources-by-code-in-x

  • Suggested answer
    Martin Dráb Profile Picture
    236,503 Most Valuable Professional on at
    RE: How to filter form using child data source field

    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.

  • Ram Kumar Profile Picture
    454 on at
    RE: How to filter form using child data source field

    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 ?

    Regards,

    Ram

  • Suggested answer
    Martin Dráb Profile Picture
    236,503 Most Valuable Professional on at
    RE: How to filter form using child data source field

    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.

Helpful resources

Quick Links

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,882

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 525 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans