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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

DataSource RegisterOverRide method.

(0) ShareShare
ReportReport
Posted on by 24

Hi guys,

         My Requirement is need to exclude my Form's datasource executeQuery() method, Is posible to use RegisterOverRide in Form's datasource methods. Any idea?

I have the same question (0)
  • GirishS Profile Picture
    27,833 Moderator on at

    Hi Arjun,

    Can you elaborate on your question? What is the functionality you are doing and what is a need to exclude call to executeQuery method.

    Based on that we will give you a suggestion.

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    238,749 Most Valuable Professional on at

    Can you tell us more about your requirement, please?

    If you don't want the query to execute automatically, can't you simply turn it off (by setting it AutoSearch property of the data source to No)?

    Using registerOverrideMethod() is possible, why would you do it in your form? If you need to change executeQuery() method, simply, change its code. For example, if you want executeQuery() to be called automatically but you want to skip the method body in some cases, simply put an "if" condition to executeQuery().

  • Arjun Venkatesan Profile Picture
    24 on at

    Hi Mr.Martin and Mr.Girish,

         Thanks for your reply, I'm new in D365fo, Actually my requirement is I need to change the logic of existing form's executeQuery() method. That Form have executeQuery() method with different tables joining. I need to exclude them and have to add my own logic on that executeQuery() method which means need to avoid existing executeQuery code it should run my logic only.

    If its is possible with registerOverrideMethod() please guide me how to use?

  • GirishS Profile Picture
    27,833 Moderator on at

    Form you are referring to is a custom form or standard form?

    Thanks,

    Girish S.

  • Martin Dráb Profile Picture
    238,749 Most Valuable Professional on at

    Your dwsign sounds wrong to me. If you use a custom method instead of executeQuery(), the kernel implementation of executeQuery() won't be called and therefore the query won't execute and data won't be loaded.

    Please tell us more about the actual problem, so we can help you with designing a feasible solution.

    For example, if the override of executeQuery() in the standard form adds query data sources that you don't want, you can disable them by your code.

  • Arjun Venkatesan Profile Picture
    24 on at

    Yes,

     Hi Mr.Girish yes Referring form is also a custom Form but different model. I mean I'm trying to reach this with my two custom models.

  • GirishS Profile Picture
    27,833 Moderator on at

    If it's a custom form - Is, it possible to do the changes directly in that form?

    If not, then as Martin mentioned you can clear out the DataSource joins from the eventhandler or COC of the executeQuery method.

    You can make use of clearLink method on the QueryBuildDataSource class to clear out the added DataSource and add your own DataSource with joins.

    Thanks,

    Girish S.

  • Arjun Venkatesan Profile Picture
    24 on at

    Thanks for the reply Mr.Girish,

               So Datasource methods Can't do registerOverRide()?

  • GirishS Profile Picture
    27,833 Moderator on at

    No, you can do via registerOverride method also. But that's not needed you can simply add your code in the event handler or COC of executeQuery method.

    If you still want to do it with registerOverride method, then the syntax will be something like below.

    FormDataSourceName_ds.registerOverrideMethod(methodstr(methodToOverride, methodToCall));
    FormDataSourceName_ds.registerOverrideMethod(methodstr(FormDataSource, executeQuery), formMethodstr(
            FormName, MethodName)

    Thanks,

    Girish S.

  • Arjun Venkatesan Profile Picture
    24 on at

    Really Thank you So much brother.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 510 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 399

#3
Adis Profile Picture

Adis 251 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans