Using complex query ranges

public void lookup(FormControl _formControl, str _filterStr)
{
Query query = new Query();
QueryBuildDataSource queryDataSourceCode;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
str st;
;

sysTableLookup=SysTableLookup::newParameters(tableNum(InventTable), _formControl);
sysTableLookup.addLookupField(fieldNum(InventTable, ItemId));
sysTableLookup.addLookupField(fieldNum(InventTable, NameAlias));
queryDataSourceCode = query.addDataSource(tableNum(InventTable));

queryDataSourceCode.addRange(fieldNum(InventTable, ItemId)).value(
strFmt(‘(((%1.%2 >= 40) && (%1.%2 <= 60)) || ((%1.%3 >= 20) && (%1.%3 <= 30)))’,
queryDataSourceCode.name(),
fieldStr(InventTable, NetWeight),
fieldStr(InventTable, TaraWeight)));

sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s