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, ...
Unanswered

Execute query not called

(0) ShareShare
ReportReport
Posted on by

I have multiple datasources on a form and I see data coming from all of them. Now I need to add range so I am overriding executeQuery methods (not init since the ranges values will be changed based on user input/filter controls).

The problem I faced is that only the executeQuery of first datasource is called and not the others. I observed this behavior using break points. The data sources joins are as followed:

  1. 1st datasource
  2. 2nd datasource (inner join with 1st)
  3. 3rd datasource (outer join with 2nd)
  4. 4th datasource (outer join with 3rd)

Is there any solution or work around?

I have the same question (0)
  • Martin Dráb Profile Picture
    236,182 Most Valuable Professional on at
    RE: Execute query not called

    Your four data sources are joined, which means they form a single query returning all data at once. There aren't four separate queries.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Execute query not called

    Hi AR01,

    ExecuteQuery will be called when loading the form for datasource1. It will be called for the child data sources had the joln type been "Delayed". 

    I think the first way would be correct for you. You can set the range in the parent executeQuery method and call it when the user selects the checkbox.

  • Community Member Profile Picture
    on at
    RE: Execute query not called

    First two datasource contains Ticket(ISV customization) information,

    3rd, 4th contains Contract information (ISV customization),

    5th datasource contains a check field(NoYes) and linked with 4th datasource.

    So a ticket is linked with 2 contracts, first has check Yes in 5th datasource and other contract has check No.

    So the user is just selecting a check box to see the desired records.

    That's the whole scenario.

    I found 2 work arounds:

       1. I am able to get the desired records if I call executeQuery via code from parent datasources.

       2. I am also able to get the same desired records if I change the joinMode of 5th datasource to Exists join and add its range in the executeQuery of first datasource before super().

    But still I am confused why the executeQuery not called by default. The relations between these datasource are defined at table level.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Execute query not called

    Could you please provide an example of the data you are trying to filter? Since datasource 5 has an outer join, the parent table records will not be affected by the filtering these records. Please share your code as well.

  • Community Member Profile Picture
    on at
    RE: Execute query not called

    I am adding the 5th datasource with outer join from 4th datasource and overriding the executeQuery of 5th datasource.

    Yes, the filtering criteria is based on user input.

    what I observed that no executeQuery method is called other than 1st datasource.

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Execute query not called

    Hi AR01,

    On which datasource are you overriding the executeQuery method? Are you getting the filtering criteria based on another control on the form which the accepts user input?

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 2,339

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 600 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans