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 :
Microsoft Dynamics AX (Archived)

Pre and Post event handler.

(0) ShareShare
ReportReport
Posted on by 56

Dear All,

I read in blogs about "Event Handlers" on Class. Pre and Post event handler. But i have one confusion.

Can you please let me know what is exactly use of event handler and when to use?

Please give me more shed on this.

Thanks!

Arpan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    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.

    Please refer following links:

    (Event Handling in Microsoft Dynamics AX 2012)

    www.erpsoftwareblog.com/.../event-handling-in-microsoft-dynamics-ax-2012

    (How to use Event Handler in Microsoft Dynamics AX 2012:)

    chaituax.wordpress.com/.../how-to-use-event-handler-in-microsoft-dynamics-ax-2012

  • @rp@n Profile Picture
    56 on at

    Thanks Chaitanya,

    Suppose if i am going to create a new Customer. So,before customer creation i want to run some business logic that logic should be write in to "Pre event" and after Customer creation if i want to send emails to users so, that logic should be write in to"Post event".

    Is't correct?

    Please give me more shed on this.

    Arpan

  • Verified answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    Hi @rp@n

    Event Handlers in X++ look like trigger in SQL, you can run business logic after and before update or insert

    for more details

    amazingax.wordpress.com/.../microsoft-dynamics-ax-2012simple-use-of-eventing-frameworkpart-1use-of-coded-events

  • @rp@n Profile Picture
    56 on at

    Thanks Sukkrut and Hakim

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Yes. Probably you can create Pre and post insert eventhandlers to custTable insert method and include your custom code over there.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans