Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Pre and Post event handler.

Posted on by 5,901

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
    Chaitanya Golla 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
    @rp@n 5,901 on at
    RE: Pre and Post event handler.

    Thanks Sukkrut and Hakim

  • Verified answer
    Mahmoud Hakim Profile Picture
    Mahmoud Hakim 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
    @rp@n 5,901 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
    Chaitanya Golla 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans