Skip to main content
Post a question

Notifications

Community site session details

Community site session details

Session Id : by/BbIx7sho6sHj6DONvBx
Microsoft Dynamics AX (Archived)

Dax 2009 - Attach event listeners to an AOT class method like LogInsert

Like (0) ShareShare
ReportReport
Posted on 15 Mar 2013 12:11:56 by 695

I to create an X++ class that will listen for calls to say the logInsert class method.

There doesn't seem to be very much around thins in Dax 2009

Thanks

*This post is locked for comments

  • Verified answer
    Martin Dráb Profile Picture
    232,195 Most Valuable Professional on 18 Mar 2013 at 07:13:50
    RE: Dax 2009 - Attach event listeners to an AOT class method like LogInsert

    What exactly do you want to show?

    You surely know how to call a method from logInsert(). About observer, you could store a collection of objects (implementing some common interface) and when the event is fired, you would iterate through them and call a method on each object. The observed object would expose methods for subscribing and unsubscribing (i.e. adding and removing objects from the collection of listeners). But don't do it if you don't need such flexibility - I simply don't know your requirements.

  • LeeRoberts Profile Picture
    695 on 15 Mar 2013 at 14:16:38
    RE: Dax 2009 - Attach event listeners to an AOT class method like LogInsert

    Thanks for getting back to me Martin.

    Would you be able to provide me with an example?

  • Martin Dráb Profile Picture
    232,195 Most Valuable Professional on 15 Mar 2013 at 12:47:15
    RE: Dax 2009 - Attach event listeners to an AOT class method like LogInsert

    You'll have to change the method to notify your class. If you want to be able to subscribe and unsubscribe from the notification, you can implement the Observer pattern.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,323 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,195 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading started
Loading complete