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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Calling custom method from form datasource in a form control event handler

(1) ShareShare
ReportReport
Posted on by 2,699
Hi All,
 
I have read this post https://community.dynamics.com/forums/thread/details/?threadid=391a4b99-f612-41eb-bef6-3f7dc26df454 cover to cover and I will explain my scenario - hopefully someone can assist.
 
I have written an extension to the TsTimesheetEntry form.
 
The extension is a simple check box added to the form that when turned on, the modified event handler method attempts to call a custom data method which has been added as an extension on the TsTimesheetTable form datasource.
 
The idea is that if the form control is marked to true, this custom method on the form data source should be called to alter the query on the form and refresh.
 
The issue I am having is similar to others in this blog but no matter which combination of the solutions I try, when I attempt to call the custom data method from the form data source in my form control event handler the system complains that the method cannot be found:  

Error executing code: FormDataSource object does not have method 'delegateQuery'.
 
But the custom method delegateQuery has been added via a form extension CoC method 
 
[ExtensionOf(formDataSourceStr(TsTimesheetEntry, TSTimesheetTable))]
 
public void delegateQuery(NoYes _applyFilter)
{              
      // query logic changed
}
 
My question is - how can I successfully call this custom data method from another custom form control event handler method.
 
Thanks in advance
I have the same question (0)
  • Suggested answer
    Layan Jwei Profile Picture
    8,118 Super User 2025 Season 2 on at
    Hi Kauto,
     
    The link you provided is not working. Also can you please show us your code in the event handler to be able to help.
     
    But in general, if you are facing an issue when calling the coc method in the modified event handler, then why not put the modification logic using coc instead of event handlers? You still can use extensions.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • André Arnaud de Calavon Profile Picture
    301,119 Super User 2025 Season 2 on at
    Hi Kauto,
     
    As moderator, I corrected the link in your question. It had some invalid characters at the end of the URL. Please share the coding you applied, so we might be able to understand what you did so far and we can see how to help you.

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…

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
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans