MenuFunction.new Method [AX 2012]
Creates a new xMenuFunction object by passing xMenuFunction's name and MenuItemType to the xMenuFunction constructor.
In the following example, a try block tries to create and run an object of type MenuFunction. The catch block then handles the specific system class exception and prints an error message.
MenuFunction mf;
try
{
mf = new MenuFunction("AddressFormat", MenuItemType::Display);
mf.run();
}
// Exception handler.
catch(Exception::Internal)
{
print "MenuFunction does not exist";
pause;
}
Community Additions
ADD
Show: