Skip to main content

Notifications

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 22

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

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: Pre and Post event handler.

    Hi,

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

  • @rp@n Profile Picture
    22 on at
    RE: Pre and Post event handler.

    Thanks Sukkrut and Hakim

  • Verified answer
    Mahmoud Hakim Profile Picture
    17,887 on at
    RE: Pre and Post event handler.

    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
    22 on at
    RE: Pre and Post event handler.

    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
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: Pre and Post event handler.

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans