public void lookup(FormControl _formControl, str _filterStr)
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource qbdsJoin;
SysTableLookup sysTableLookup;
CompanyInfo CompanyInfo;
// super(_formControl, _filterStr);
changeCompany(DMS_IMEIDelinkingTable.DataArea)
{
select firstOnly DMSDivisionCode
from CompanyInfo
where CompanyInfo.DataArea == DMS_IMEIDelinkingTable.DataArea;
sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable), _formControl);
qbds = query.addDataSource(tableNum(InventTable));
qbdsJoin = qbds.addDataSource(tableNum(DmsSkuDetailsTable));
qbds.relations(false);
qbds.fields().dynamic(NoYes::Yes);
qbdsJoin.addLink( fieldNum(InventTable, ItemId),fieldNum(DmsSkuDetailsTable, ProductCode));
qbdsJoin.joinMode(JoinMode::InnerJoin);
qbdsJoin.addRange(fieldNum(DmsSkuDetailsTable,DivisionCode)).value(CompanyInfo.DMSDivisionCode);
qbdsJoin.addOrderByField(fieldnum(DmsSkuDetailsTable, ProductCode));
sysTableLookup.addLookupField(fieldnum(InventTable, ItemId));
sysTableLookup.addLookupField(fieldnum(InventTable, NameAlias));
qbds.orderMode(OrderMode::GroupBy);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
}
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource qbdsJoin;
SysTableLookup sysTableLookup;
CompanyInfo CompanyInfo;
// super(_formControl, _filterStr);
changeCompany(DMS_IMEIDelinkingTable.DataArea)
{
select firstOnly DMSDivisionCode
from CompanyInfo
where CompanyInfo.DataArea == DMS_IMEIDelinkingTable.DataArea;
sysTableLookup = SysTableLookup::newParameters(tableNum(InventTable), _formControl);
qbds = query.addDataSource(tableNum(InventTable));
qbdsJoin = qbds.addDataSource(tableNum(DmsSkuDetailsTable));
qbds.relations(false);
qbds.fields().dynamic(NoYes::Yes);
qbdsJoin.addLink( fieldNum(InventTable, ItemId),fieldNum(DmsSkuDetailsTable, ProductCode));
qbdsJoin.joinMode(JoinMode::InnerJoin);
qbdsJoin.addRange(fieldNum(DmsSkuDetailsTable,DivisionCode)).value(CompanyInfo.DMSDivisionCode);
qbdsJoin.addOrderByField(fieldnum(DmsSkuDetailsTable, ProductCode));
sysTableLookup.addLookupField(fieldnum(InventTable, ItemId));
sysTableLookup.addLookupField(fieldnum(InventTable, NameAlias));
qbds.orderMode(OrderMode::GroupBy);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
}
No comments:
Post a Comment