web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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 30

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
    30 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
    30 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans