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?
Really Thank you So much brother.
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.
Thanks for the reply Mr.Girish,
So Datasource methods Can't do registerOverRide()?
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.
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.
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.
Form you are referring to is a custom form or standard form?
Thanks,
Girish S.
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?
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().
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.
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156