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

Notifications

Announcements

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)
  • Arjun Venkatesan Profile Picture
    24 on at

    Really Thank you So much brother.

  • GirishS Profile Picture
    27,829 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

    Thanks for the reply Mr.Girish,

               So Datasource methods Can't do registerOverRide()?

  • GirishS Profile Picture
    27,829 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

    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.

  • Martin Dráb Profile Picture
    238,286 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.

  • GirishS Profile Picture
    27,829 Moderator on at

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

    Thanks,

    Girish S.

  • 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?

  • Martin Dráb Profile Picture
    238,286 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().

  • GirishS Profile Picture
    27,829 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.

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 843 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 322 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans