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)

AX 2012 - common class.

(0) ShareShare
ReportReport
Posted on by

I need to run some code in before each method (when method starts - I need to run a specific code - That's is for QA manner, and is running when I need to), and at the end of each method.

How can I do that?

Is there any way or class which is common to all the classes and tables?

(Of course, I don't want that my method will also running in that class, or whatever is the solution, so there were not be an infinitive loop).

Handle of the class is also fine (so I can write in C#), but X++ is the preferred way.

Thanks :)

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    syed baber Profile Picture
    11,633 on at

    You need to write pre and post event handlers for a method if you want to run specific logic before and after a method. Check the following link for X++ event handling:

    msdn.microsoft.com/.../gg839762.aspx

    Thanks,

    Baber.

  • Amir Nazim Profile Picture
    5,994 on at

    could you explain what would you like to achieve with this ? Baber solution will works for specific classes/ tables methods. You would like to achieve some security ?

  • Suggested answer
    DG Profile Picture
    1,226 on at

    Hi Eitan,

    I am not aware of any such method. Alternatively, there is a utility called 'Trace parser' available which you can set to see all X++ calls. If only auditing is the purpose, it will serve it.

    Regards,

    Deepak

  • Community Member Profile Picture
    on at

    What I meant is not adding pre+post handler on a method.

    Just handling pre+post (I know the method name).

    That's for some QA purpose, or someone who doesn't need to deal with code for farther progress.

    Thanks :)

  • Suggested answer
    Iulian Cordobin Profile Picture
    8,201 on at

    Basically if you are asking if there is an 'Object' class that is used to derive every class in AX that you can implement code into the answer is no.

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans