1 public void fld1_1_lookup(FormControl _formControl, Name _ReportName)
2 {
3 Query query = new Query();
4 QueryBuildDataSource queryBuildDataSource;
5 SysTableLookup sysTableLookup;
6 FormStringControl _control = dialog.formRun().controlCallingMethod();//This is very important
7 ;
8
9 _formControl = _control;
10 sysTableLookup = SysTableLookup::newParameters(tablenum(QVS_ReportName), _formControl);
11
12 sysTableLookup.addLookupfield(fieldnum(QVS_ReportName, ReportId));
13 sysTableLookup.addLookupfield(fieldnum(QVS_ReportName, ReportName), true);
14
15 queryBuildDataSource = query.addDataSource(tablenum(QVS_ReportName));
16 if(_ReportName)
17 queryBuildDataSource.addRange(fieldnum(QVS_ReportName, ReportName)).value(strfmt("*%1*", _ReportName));
18
19 sysTableLookup.parmQuery(query);
20 sysTableLookup.performFormLookup();
21 }