open a form through a dilaog

Hi frnds,

i have a issue please tell me if u know

i have a form with 5 fields and also have a dailog with same 5 feilds

suppose i open a dialog with data then press '‘Ok"’

now i want open a form from dailog(when i press '‘ok’)

thanks in advance

try this below code.

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;

}

public container pack()

{

return conNull();

}

public boolean unpack(container _packedClass)

{

return true;

}

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;

}

public boolean getFromDialog()

{

custAccount = fieldAccount.value();

custName = fieldName.value();

custGroupId = fieldGroup.value();

currencyCode = fieldCurrency.value();

paymTermId = fieldPaymTermId.value();

paymMode = fieldPaymMode.value();

return super();

}

public void run()

{

// Place your code here for example

// mention your form name

/* TEC_InvoiceDetailsClass invoiceClass;
FromDate _fromDate;
ToDate _toDate;
ItemId _itemId;
Object formRun;
Args args1 = new Args(formstr(TEC_InvoiceDetailsForm));
;
formRun = ClassFactory.formRunClass(args1);
formRun.parmItemId(itemId);
formRun.parmFromDate(fromDate);
formRun.parmToDate(toDate);
formRun.init();
formRun.run();
formRun.detach();*/

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));

}

public static void main(Args _args)

{

CustCreate custCreate = new CustCreate();

if (custCreate.prompt())

{

custCreate.run();

}

}