Apr 19, 2012

Showing the value of one field value on basis of another field on the dialog


The following code is for : When u select CustomerId in Field1 then it automatically takes the name of the selected CustomerId in field2...

public class ReportRun extends ObjectRun
{
     DialogField            dialogfield1,dialogfield2;
     CustAccount          custId;
     Name                   name;
}


 public Object dialog(Object _dialog)
  {
    DialogRunbase dialog = _dialog;
    ;
    dialog.caption('Customer information ');
    dialog.addGroup('Select CustomerId :');
    dialogfield1 = dialog.addField(typeid(CustAccount),"Cust Id : ");
    dialogfield1.value(custId);
    dialogfield2 = dialog.addField(typeid(Name),"Cust name : ");
    dialog.allowUpdateOnSelectCtrl(true);

    return dialog;
  }


public void dialogSelectCtrl()

{
     ;
     dialogfield2.value(custTable::find(dialogfield1.value()).Name);
}


boolean getFromDialog()
{
    ;
    custId   =   dialogfield1.value();
    name     =   dialogfield2value();
    return true;.
}