Simple Dialog Box in Axapta 2012
Hi Folks,
The following example displays the dialog box and prints the value entered to the screen.
The following example displays the dialog box and prints the value entered to the screen.
Code:
static void theAxapta_DialogBox(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;
}
}
Output:
Note:
1. The dialog.run() method returns true if OK is clicked, and false if Cancel is clicked.
2. Dialog Group is used to group dialog fields which are logically same.
-Harry
Thanks alot Agarwal..Nice article everything is clear in your post for Dialog box.I hope this is very useful to all AX developers.
ReplyDeleteHi Suresh,
DeleteIts good to hear that my post helps you. Keep in touch for latest update and also i need you guys feenback on the same.
Can you please explain the syntax?
ReplyDeleteHi Raj,
DeleteWhich syntax you want to understand?
i understood the concept dialog box
ReplyDeletethanks for your post
Hi!
ReplyDeleteI'm absolutely new to ax, and the major problem with such examples is lack of the seemingly obvious steps. Like for instance - how to call this method and what arguments to pass? (Args _args)
Hi Lauris,
DeleteHere i posted this code under a job thats why used Args to execute this identically. If you are putting code in any existing object you dont need to use Args. You can try to copy paste this code on a click event of new button (add a new button on any form).
dialog dialog;
dialogGroup dialogGroup;
dialogField dialogField;
;
dialog = new Dialog("Simple Dialog");
dialogGroup = dialog.addGroup("Customer");
dialogField = dialog.addField(extendedTypeStr(custAccount));
dialog.run();
if(dialog.closeok())
{
print dialogField.value();
pause;
}
Hi i need Based on first dialog field the second dialog field should be filter
ReplyDeletewill you please help me