web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 28

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

Responsible AI policies

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

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans