How to pass action menu item as args to class

Hi,

How to pass action menu item as argument to class main method in ax 2012.

classs like ABC

ABC::main(actionmenuitemArgu);

Regards,

you can use args.parm(‘MenuItemName’). But what is the purpose of sending menu item?

Hi,
while debug class main method args Parameter getting value like “Args(, Parm: , MenuItemName: ABC)”.so i want to pass this value before calling main method.

Regards,

Not sure that does that mean.
Have you tired using args.parm()?

Hi,
yes…but Error like operand value is incompatible with operator.

str multiSelectString = “ABC”;
Args args ;
args = new Args();
new MenuFunction(identifierstr(multiSelectString), MenuItemType::Action).run(args);
ABC= ABC::main(args);

Is ABC is a action menu item? If so use the below code…
new MenuFunction(menuitemActionstr(ABC), MenuItemType::Action).run(args);

yes…but i want to pass this value to main method class.

Is this what you are looking for?

str multiSelectString = “ABC”;
Args args ;
args = new Args();
args.parm(multiSelectString );
ABC= ABC::main(args);

I tired this one but getting error like “Operand types are not compatible with the operator”

ABC= ABC::main(args); → main is a void method. You should be just calling it.
ABC::main(args);