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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNQTPNW3g8d1YbE8z_bII4mG0jgnBLQHhYXCQ5RrXkZLitesiFSAzw6AQyajm71mw2FhwSd5__s2MU6kAgtOEV23F-HeUU0iKXU-LLTXRZtWTW5wQbXmvPE2H3S_rGC3mvez_LXvf02Q/s400/9.png)
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