Creating a Simple Dialog:
The application class Dialog is used to build dialogs. Other application classes, such as
DialogField, DialogGroup, DialogTabPage, and others, are used to create dialog
controls. A common way of using dialogs is within the RunBase framework classes, where
user input is required
Steps:
- Expand AOT and create a new Class and name it CustCreate as me..
- And Copy the following Code
method 1;
class CustCreate extends RunBase
{
DialogField fieldAccount;
DialogField fieldName;
DialogField fieldGroup;
DialogField fieldCurrency;
DialogField fieldPaymTermId;
DialogField fieldPaymMode;
CustAccount custAccount;
CustName custName;
CustGroupId custGroupId;
CurrencyCode currencyCode;
CustPaymTermId paymTermId;
CustPaymMode paymMode;
}
method 2;
public container pack()
{
return conNull();
}
method 3:
public boolean unpack(container _packedClass)
{
return true;
}
method 4:
protected Object dialog()
{
Dialog dialog;
DialogGroup groupCustomer;
DialogGroup groupPayment;
dialog = super();
dialog.caption("Customer information");
fieldAccount = dialog.addField(extendedTypeStr(CustVendAC),"Customer account");
fieldName =dialog.addField(extendedTypeStr(CustName));dialog.addTabPage("Details");
groupCustomer = dialog.addGroup("Setup");
fieldGroup = dialog.addField(extendedTypeStr(CustGroupId));
fieldCurrency = dialog.addField(extendedTypeStr(CurrencyCode));
groupPayment = dialog.addGroup("Payment");
fieldPaymTermId = dialog.addField(extendedTypeStr(CustPaymTermId));
fieldPaymMode = dialog.addField(extendedTypeStr(CustPaymMode));
return dialog;
}
method 5:
public boolean getFromDialog()
{
custAccount = fieldAccount.value();
custName = fieldName.value();
custGroupId = fieldGroup.value();
currencyCode = fieldCurrency.value();
paymTermId = fieldPaymTermId.value();
paymMode = fieldPaymMode.value();
return super();
}
method 6:
public void run()
{
info("You have entered customer information:");
info(strFmt("Account: %1", custAccount));
info(strFmt("Name: %1", custName));
info(strFmt("Group: %1", custGroupId));
info(strFmt("Currency: %1", currencyCode));
info(strFmt("Terms of payment: %1", paymTermId));
info(strFmt("Method of payment: %1", paymMode));
}
method 7:
public static void main(Args _args)
{
CustCreate custCreate = new CustCreate();
if (custCreate.prompt())
{
custCreate.run();
}
3.In order to test the dialog, run the class. The following form should appear with the
General tab page open initially:
4.Enter the cust account and name









