Kindly clarify one doubt

Hi Pioneers,

I am new to AX…In order to learn AX, I came across a syntax, which I seek clarification from you pioneers…

In many methods in AX, We can see, written as :

public void ABC(Args _args) or static void abc (Args _args) etc. etc.

I just want to know, the concept of writing (Arrgs _args), in bracket, with the method name…under which circumstance we write this.

Awaiting your responses pioneers…

Awaiting your valuable responses…

Kindly guide me.

Args class is quite an generic solution for passing parameters to an object. For example, nobody knows in advance what parameters will be needed in any individual form, but we still need a way to do that - and it should be consistent. Therefore forms accept Args parameter and make it available in init() method, where you can extract concrete values you’re interested in. The obvious disadvantage of this approach is that Args’s values are not strongly typed (e.g. you’ll get Common type instead of a specific table), therefore you have to validate and cast the values.

Args object is also automatically passed to main() methods by menu items - and your main() method won’t work for that unless it accepts Args as parameter.

Also don’t miss the documentation.