public void lookup()
{
Query query;
QueryBuildDataSource queryBuildDataSourceTable;
QueryBuildDataSource queryBuildDataSourceTableDescriptions;
QueryBuildRange queryBuildRange;
//you need to define the multitable, but initalize it AFTER you have defined the query
//SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(UnitOfMeasure), ctrl);
SysMultiTableLookup sysTableLookup;
query = new Query();
super();
queryBuildDataSourceTable = query.addDataSource(tableNum(VendTable));
//join the translation table so we can get a description of the UOM
queryBuildDataSourceTableDescriptions = queryBuildDataSourceTable.addDataSource(tableNum(DirPartyTable));
queryBuildDataSourceTableDescriptions.joinMode(JoinMode::InnerJoin);
queryBuildDataSourceTableDescriptions.relations(false);
queryBuildDataSourceTableDescriptions.addLink(fieldNum(VendTable, Party),fieldNum(DirPartyTable, RecId));
//filter by the unit class being passed
queryBuildRange = queryBuildDataSourceTable.addRange(fieldNum(VendTable, Party));
///queryBuildRange.value(queryValue(unitClass));
//define multiple table lookup query
sysTableLookup = SysMultiTableLookup::newParameters(this, query);
//add which fields will be displayed to the user (symbol + desc.)
sysTableLookup.addLookupfield(fieldNum(VendTable, AccountNum),1 );
sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name),2,true);
//do not use for multi table
//sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
==========================================================
public void lookup()
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource qbdsJoin;
SysTableLookup sysTableLookup = sysTableLookup::newParameters( tableNum(VendTable), this);
;
qbds= query.addDataSource( tableNum(VendTable));
qbdsJoin= qbds.addDataSource( tableNum(DirPartyTable));
qbdsJoin.relations( false);
qbdsJoin.fields().dynamic(NoYes::Yes);
qbdsJoin.addLink( fieldNum(VendTable, Party), fieldNum(DirPartyTable, RecId));
qbdsJoin.joinMode(JoinMode::InnerJoin);
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield( fieldNum(VendTable, AccountNum), true);
sysTableLookup.addLookupfield( fieldNum(VendTable, VendGroup), true);
sysTableLookup.addLookupfield( fieldNum(VendTable, Party));
sysTableLookup.performFormLookup();
}
{
Query query;
QueryBuildDataSource queryBuildDataSourceTable;
QueryBuildDataSource queryBuildDataSourceTableDescriptions;
QueryBuildRange queryBuildRange;
//you need to define the multitable, but initalize it AFTER you have defined the query
//SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(UnitOfMeasure), ctrl);
SysMultiTableLookup sysTableLookup;
query = new Query();
super();
queryBuildDataSourceTable = query.addDataSource(tableNum(VendTable));
//join the translation table so we can get a description of the UOM
queryBuildDataSourceTableDescriptions = queryBuildDataSourceTable.addDataSource(tableNum(DirPartyTable));
queryBuildDataSourceTableDescriptions.joinMode(JoinMode::InnerJoin);
queryBuildDataSourceTableDescriptions.relations(false);
queryBuildDataSourceTableDescriptions.addLink(fieldNum(VendTable, Party),fieldNum(DirPartyTable, RecId));
//filter by the unit class being passed
queryBuildRange = queryBuildDataSourceTable.addRange(fieldNum(VendTable, Party));
///queryBuildRange.value(queryValue(unitClass));
//define multiple table lookup query
sysTableLookup = SysMultiTableLookup::newParameters(this, query);
//add which fields will be displayed to the user (symbol + desc.)
sysTableLookup.addLookupfield(fieldNum(VendTable, AccountNum),1 );
sysTableLookup.addLookupfield(fieldNum(DirPartyTable, Name),2,true);
//do not use for multi table
//sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
==========================================================
public void lookup()
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource qbdsJoin;
SysTableLookup sysTableLookup = sysTableLookup::newParameters( tableNum(VendTable), this);
;
qbds= query.addDataSource( tableNum(VendTable));
qbdsJoin= qbds.addDataSource( tableNum(DirPartyTable));
qbdsJoin.relations( false);
qbdsJoin.fields().dynamic(NoYes::Yes);
qbdsJoin.addLink( fieldNum(VendTable, Party), fieldNum(DirPartyTable, RecId));
qbdsJoin.joinMode(JoinMode::InnerJoin);
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield( fieldNum(VendTable, AccountNum), true);
sysTableLookup.addLookupfield( fieldNum(VendTable, VendGroup), true);
sysTableLookup.addLookupfield( fieldNum(VendTable, Party));
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment