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

Event handlers

(0) ShareShare
ReportReport
Posted on by 178
Hi,
 
When event handlers will be better to use than CoC?
 
One example i can think of, is if let's say for a certain form, i want to add code for 5 different form controls. In this case creating one event handler class with 5 events is better than creating 5 different classes with CoC. As I will have logic for them in one place.
But if it was only one form control to change, then i can use CoC directly as it's easier to implement in terms i
of code. But still there could come more modifications in the future where i might end with 4 CoCs because i first started with CoC when it was one change only. (Where maybe i can revert back to event handlers or stick with CoC)
 
What else?
Categories:
I have the same question (0)
  • Suggested answer
    Subra Profile Picture
    526 on at
    Hi @CU22120935-0

    If it's possible you can implement your business logic in table level with COC instead of form control events, so that we can reuse the same for the future customization.

    If you are using event handler it will be availble to specific forms control events only.
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • CU22120935-0 Profile Picture
    178 on at
    Hi @Subra,

    Thank you, i know that putting code on table level is better than form control. (but i could still use both CoC or event handlers to put code on table level)

    My question was when would using event handlers be better than CoC. i could put code on form control using CoC for 5 different form controls or i can do it using event handlers for 5 controls.

    i said one advantage might be for event handlers in this case is i could create 1 class for all of those 5 changes while for CoC it will be 5 classes (so that might be a win for event handlers)

    In general when would event handlers be better than CoC? other than my example
    Also is there a case where event handlers is a must and CoC won't work?
  • Suggested answer
    Subra Profile Picture
    526 on at
    Hi 

    Please check the below one for more information and let me know if you are looking for more information.

    https://community.dynamics.com/forums/thread/details/?threadid=4a88b164-ecc6-4113-8b8f-c85c401d01e3
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 664

#2
André Arnaud de Calavon Profile Picture

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

#3
CP04-islander Profile Picture

CP04-islander 550

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans