Friday, June 29, 2018

Dialog Boxes

Dialog boxes are a simplified type of form in Microsoft Dynamics AX, and they
are generated from the Dialog class. They create a dialog with the user where the
user can input values. Dialog boxes are not used in complex scenarios; forms are
the preferred method in complex situations. All dialog boxes have a standardized
form that contains an
OK/Cancel option.NOTE: The Dialog class described here is a different concept then the Dialog
Form Template available as a context-menu option on the Form node in the
AOT. This topic describes creating Dialog forms using X++ code.

The following is an example of the OK/Cancel dialog box.

The following example displays the dialog box and prints the value entered to the
screen.
static void Simple_Dialog(Args _args)
{
dialog dialog;
dialogGroup dialogGroup;
dialogField dialogField;
dialog = new Dialog("Simple Dialog");
dialogGroup = dialog.addGroup("Customer");
dialogField =
dialog.addField(extendedTypeStr(custAccount));
if (dialog.run())
{
print dialogField.value();
pause;
}
}
The dialog.run() method returns true if OK is clicked, and false if Cancel is
clicked


Best Regards,
Hossein Karimi

No comments:

Post a Comment

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...