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.
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:
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 ?
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.
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.
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.