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, ...
Answered

Pre-event handler and post-event handler

(0) ShareShare
ReportReport
Posted on by 154

I want to overwrite the clicked method of a standard form extension. I can only use event handlers. So do I use pre or post? 

How do you know when you use them?

I have the same question (0)
  • Blue Wang Profile Picture
    Microsoft Employee on at

    Hi PrachiGupta,

    The most common case where we use eventhandlers is when we want to execute any custom business logic prior/later to insert/update of table record or based on activity(on class) to trriger the event. Usage is that for new custom code, we can make use of event handlers without adding any code to the standard code(decoupling) and thereby more organized by placing/grouping code in one class.

    More details ,please refer this thread:

    community.dynamics.com/.../694300

  • Verified answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    You can't override (replace) the standard method. OnClicking is executed before the super call of the clicked method, onClicked is executed after the super call. Pre-/post handlers are executed before/after the clicked method.

    Any code in the clicked method will be executed anyway.

    In clicked methods it's quite common to use post handler or onClicked event but it always depends on your scenario and functional requirement, which we don't know.

  • PrachiGupta97 Profile Picture
    154 on at

    I need to write my custom code in active () method of a form extension datasource to disable and enable a button.

    But I cannot overridde it since it is a standard form extension. So which event handlers do I use?

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 March 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 733

#2
André Arnaud de Calavon Profile Picture

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

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 278 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans