Finally I found that in new Dynamics Ax finally statement introduce in exception handling statement.
I found Info box in browser as

try
{
}
catch
{
}
finally
{
}
It means, everything written in finally must be execute. For testing this functionality I just create a runnable class and written following code.
class HelloWorldWhen run the code.
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
ColorDC dc = new ColorDC();
ColorSc Sc = new ColorSc();
try
{
dc.parmColorName("Red");
Sc.InsertColor(dc);
dc.parmColorName("Green");
Sc.InsertColor(dc);
} catch (Exception::Error)
{
info("error");
}
finally
{
info("finally");
}
}
}
I found Info box in browser as

No comments:
Post a Comment