Lookup on Strning control:
public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(custTable), this);
sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupField(fieldNum(CustTable, CustGroup));
queryBuildDataSource = query.addDataSource(tableNum(CustTable));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, CustGroup));
queryBuildRange.value('40');
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
//super()
}
Lookup on RefereceGroup control:
public Common lookupReference(FormReferenceControl _formReferenceControl)
{
//Common ret;
//ret = super(_formReferenceControl);
//return ret;
HcmWorker worker;
Query lookupQuery;
SysReferenceTableLookup sysTableLookup = SysReferenceTableLookup::newParameters(tableNum(HcmWorker), _formReferenceControl, true);
sysTableLookup.addLookupMethod("Name");
sysTableLookup.addLookupfield(fieldNum(HcmWorker, PersonnelNumber));
lookupQuery = new Query();
lookupQuery.addDataSource(tableNum(HcmWorker));
sysTableLookup.parmQuery(lookupQuery);
worker = sysTableLookup.performFormLookup();
return worker;
}
this is on Form design control level
ReplyDelete