11 January 2011

Working with Dialog

1.Dialog in Job:
static void Dialog_Ex(Args _args)
{
Dialog dlg = new Dialog("Customer");
DialogField df;
Name name;
ABC test;
;
df = dlg.addField(typeid(SysDate),'','');

if(dlg.run())
{
info(df.value());
}
}
2.Dialog in Class
class CreateDialog extends Runbase
{
Dialog dialog1;
DialogGroup dlgGrp;
DialogTabPage dlgDialogTabPage;
DialogField dlgCustAcc;
DialogField dialogCustName;

CustAccount custAccount;
Name custName;

#DEFINE.CurrentVersion(1)
#LOCALMACRO.CurrentList
custAccount,
custName
#ENDMACRO
}
--
protected Object dialog(DialogRunbase dialog, boolean forceOnClient)
{
//Object ret;
;
//ret = super(dialog, forceOnClient);

dialog1 = super();
dialog1.caption("CustDetails");
dialog1.addTabPage("Gen");
dialog1.addGroup("Gen");
dlgCustAcc = dialog1.addFieldValue(typeid(CustAccount),"","Enter Customer");
dialogCustName = dialog1.addFieldValue(typeid(Name),"","custName");
dialog1.addTabPage("Setup");
dlgCustAcc = dialog1.addFieldValue(typeid(CustAccount),"","Enter Customer");
dialog1.addGroup("Setup");
dialogCustName = dialog1.addFieldValue(typeid(Name),"","custName");

return dialog1;
}
--
public container pack()
{
return [#CurrentVersion,#CurrentList,super()];
}
--
public boolean unpack(container packedClass)
{
Integer version = conpeek(packedClass,1);
container base;
boolean ret;
;

switch (version)
{
case #CurrentVersion:
[version,#CurrentList,base] = packedClass;
ret = super(base);
break;
default :
ret = false;
}

return ret;
}
--
public static void main(Args args)
{
CreateDialog cd;
;
cd = new CreateDialog();

if(cd.prompt())
{
cd.run();

}
}

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...