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, ...
Suggested Answer

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

(1) ShareShare
ReportReport
Posted on by 2,701
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,165 Super User 2026 Season 1 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
    303,121 Super User 2026 Season 1 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

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... 590 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 349

#3
Diego Mancassola Profile Picture

Diego Mancassola 263

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans