In this example fill the one dialog Field remaining Fields going to Unedit mode
Create new class and create classDeclaration
class CustSelect extends RunBase
{
DialogField fieldAccount,fieldName,
fieldGroup,fieldCurrecncy,
fieldPaymTermId,fieldPaymMOde;
}
Create Pack Method
public container pack()
{
return conNull();
}
Create Unpack Method
public boolean unpack (container _packedClass)
{
return true;
}
Create Dialog method
protected Object dialog()
{
Dialog dialog;
DialogGroup groupCustomer;
DialogGroup groupPayment;
dialog = super();
dialog.caption("Customer information");
//
dialog.allowUpdateOnSelectCtrls(true);
//
fieldAccount = dialog.addField(extendedTypeStr(CustAccount),"Customer account");
fieldName = dialog.addField(extendedTypeStr(CustName));
fieldName.enabled(false);
dialog.addTabPage("Details");
groupCustomer = dialog.addgroup("Setup");
fieldGroup = dialog.addField(extendedTypeStr(CustGroupId));
fieldCurrecncy = dialog.addField(extendedTypeStr(CurrencyCode));
fieldGroup.enabled(false);
fieldCurrecncy.enabled(false);
groupPayment = dialog.addGroup("Payment");
fieldPaymTermId = dialog.addField(extendedTypeStr(CustPaymTermId));
fieldPaymMOde = dialog.addField(extendedTypeStr(CustPaymMode));
fieldPaymTermId.enabled(false);
fieldPaymMOde.enabled(false);
return dialog;
}
Create DialogSelectCtrls method
public void dialogSelectCtrls()
{
CustTable custTable;
custTable =custTable::find(fieldAccount.value());
fieldName.value(custTable.name());
fieldGroup.value(custTable.CustGroup);
fieldCurrecncy.value(custTable.Currency);
fieldPaymTermId.value(custTable.PaymTermId);
fieldPaymTermId.value(custTable.PaymMode);
}
Create main()
public static void main (Args _args)
{
CustSelect custSelect = new CustSelect();
if (custSelect.prompt())
{
custSelect.run();
}
}
Comments
Post a Comment