Search This Blog

Thursday, June 27, 2013

Dialog field lookup method

Hi ,
  Dialog forms are extends with Runbase class or Runbasebatch class ,In this class dialog fields are
added in dialog method for these dialog fields we can write a lookup method in below manner

void Fld9_1_lookup()
 {
    Formrun fr = dialog.formRun();
    object Control = fr.controlCallingMethod();
    SysTableLookup       sysTableLookup = SysTableLookup::newParameters(tablenum(EmplTable),  dialogEmployee.fieldControl());
    Query                query = new Query();
    QueryBuildDataSource queryBuildDataSource;
    queryBuildRange         maintenancesection;
    ;
    sysTableLookup.addLookupfield(fieldnum(EmplTable, EmplId));
    SysTableLookup.addLookupMethod(identifierstr(name));
    sysTableLookup.addLookupfield(fieldnum(EmplTable, EAMMaintenanceSection));
    queryBuildDataSource = query.addDataSource(tablenum(EmplTable));
    maintenancesection = queryBuildDataSource.addRange(fieldnum(EmplTable,EAMMaintenanceSection));
    maintenancesection.value(SysQuery::valueNotEmptyString());
    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}
Like this we can create a lookup for dialog fields  in dialog form

Thanks
 

No comments:

Post a Comment