The following example class is to filter the records in a dialog fields
class TestDialogFields
{
Dialog dialog;
DialogField emplIdField;
}
Dialog showDialog()
{
FormRun formRun;
;
dialog = new Dialog('Dialog fields test');
emplIdField = dialog.addField(typeId(emplid) );
dialog.run(true);
dialog.formRun(). controlMethodOverload(true);
dialog.formRun(). controlMethodOverloadObject( this);
return dialog;
}
public void Fld1_1_lookup()
{
FormStringControl control = dialog.formRun(). controlCallingMethod();
SysTableLookup sysTableLookup = SysTableLookup::newParameters( tablenum(EmplTable), control);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
EmplTable EmplTable;
;
sysTableLookup. addLookupfield(fieldnum( EmplTable, EmplId));
sysTableLookup.addLookupfield( fieldnum(EmplTable, EmplIdentNumber ));
queryBuildDataSource = query.addDataSource(tablenum( EmplTable));
queryBuildDataSource.addRange( fieldnum(EmplTable,EmplId)). value(queryRange("1000","2000" ));
sysTableLookup.parmQuery( query);
sysTableLookup. performFormLookup();
}
public static void main(Args args)
{
TestDialogFields testDialogFields = new TestDialogFields();
;
testDialogFields.showDialog();
}