Kindly tell me the "Sequence of the methods called in Classes"

Hi Guys,

I am new to AX, Kindly tell me the “Sequence of the methods called in Classes”, meant to say, which method is called first, followed by other methods.(i.e., init,new,mains,run etc. etc.)

Anybody please reply…I am awaiting your responses.

It obviously depends on the class in question - you would have to elaborate your question.

Nevertheless, isn’t it easier just to use debugger to see how methods are called?

Hi,

Like we have many methods suppose…run(),main(),new(), etc. etc…I am asking abt the sequences in which they are called

Only new() exists in all classes, most classes don’t have neither main() or run(). Therefore your question doesn’t make any sense unless you specify which class you’re asking about (e.g.RunBase). Furthermore, method sequence may depend on conditional logic or how other classes use the class in question.

To try to answer at least something:

  • main() is typically invoked by menu items, but it can be called from any code as well.
  • We can safely say that new() is called before any instance method is called on the same instance - but we can’t say anything more without context.
  • run() doesn’t have any special meaning by itself, so its meaning and usage depends on context.