Tuesday 12 March 2013

Box Class

Boxes are mostly used for confirmation from the end user before executing business logic.


There are many Box methods like:
- info, warning, stop, yesNo, OkCancel etc

Class which is used to create Boxes is "Box" and all the methods are static methods in this class.
Box can be useful to beginners who are not used to the Debugger in AX as it can help them trace the path of code execution.

Here is a example job for Box class:
static void Trix_Box(Args _args)
{
    ;
    Box::info("This is an info box");
 
    Box::warning("This is a warning message");
 
    Box::stop("This is stop");
 
    if (Box::yesNo("Would you like to proceed", DialogButton::No, "A box example", "bottom text")
        == DialogButton::Yes)
        {
            info("Processing...");
        }
        else
        {
            throw error ("Process aborted");
        }
     
     
   info ("Process Complete");
}

No comments:

Post a Comment