ProdRouteOverlapCalc::main Method [AX 2012]
Provides an entry point for the ProdRouteOverlapCalc class when it is called from a menu item.
client server public static void main(Args args)
Run On
CalledParameters
- args
- Type: Args Class
The arguments for the ProdRouteOverlapCalc class.
Use the main class design pattern whenever a class is called from a menu item. Do not call the main method explicitly from the code; call it implicitly from a menu item.
Typically, you would:
-
Instantiate the class by calling the static construct method.
-
Call the prompt method to create a dialog box.
-
Call the run method, if the user clicks OK in the dialog box.
static void main(Args args)
{
ProdRoute prodRoute;
ProdRouteOverlapCalc prodRouteOverlapCalc;
boolean info = false;
if(args && args.dataset() == tablenum(ProdRoute))
{
prodRoute = args.record();
if(args.parmEnum() == NoYes::Yes)
{
info = true;
}
if (prodRoute)
{
prodRouteOverlapCalc =
ProdRouteOverlapCalc::newProdRoute(prodRoute, info, info);
}
}
if (prodRouteOverlapCalc)
{
prodRouteOverlapCalc.run();
if (args.caller())
{
args.caller().doReread();
}
}
if (!args || !args.caller() || ! args.record().TableId)
{
throw error(strfmt("@SYS22828",funcname()));
}
}
Show: