Override form lookup method along with OR condition in query range.
public void lookup(FormControl _formControl, str _filterStr)
{
//super(_formControl,
_filterStr);
SysTableLookup
sysTableLookup =
SysTableLookup::newParameters(tableNum(InventLocation),_formControl);
Query query = New
Query();
QueryBuildDataSource
queryBuildDataSource = query.addDataSource(tableNum(InventLocation));
QueryBuildRange queryBuildRange;
;
sysTableLookup.addLookupfield(fieldNum(InventLocation,
InventLocationId));
sysTableLookup.addLookupfield(fieldNum(InventLocation, Name));
sysTableLookup.addLookupfield(fieldNum(InventLocation, InventSiteId));
queryBuildRange =
queryBuildDataSource.addRange(fieldNum(InventLocation, RecId));
queryBuildRange.value(strFmt('((InventLocationType == %1) ||
(InventLocationType == %2))',
any2int(InventLocationType::Standard),
any2int(InventLocationType::Transit)));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment