public void lookup()
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource,qbdDirparty,qbdEmail;
QueryBuildRange queryBuildRange,queryBuildRangeEmail;
SysTableLookup sysTableLookup;
//LogisticsElectronicAddress
qbdEmail = query.addDataSource(tableNum(LogisticsElectronicAddress));
queryBuildRangeEmail = qbdEmail.addRange(fieldNum(LogisticsElectronicAddress,DIPL_IsSend));
queryBuildRangeEmail.value(queryValue(NoYes::Yes));
//DirPartyTable
qbdDirparty = qbdEmail.addDataSource(tableNum(DirPartyTable));
qbdDirparty.addLink(fieldNum(LogisticsElectronicAddress,PrivateForParty),fieldNum(DirPartyTable,RecId));
//CustTable
queryBuildDataSource = qbdDirparty.addDataSource(tableNum(CustTable));
queryBuildDataSource.relations(true);
queryBuildDataSource.joinMode(JoinMode::InnerJoin);
queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, AccountNum));
queryBuildRange.value(SalesTable_CustAccount.valueStr());
sysTableLookup = SysTableLookup::newParameters(tableNum(LogisticsElectronicAddress), this);
sysTableLookup.addLookupField(fieldNum(LogisticsElectronicAddress, Locator));
sysTableLookup.addLookupField(fieldNum(LogisticsElectronicAddress, DIPL_IsSend));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource,qbdDirparty,qbdEmail;
QueryBuildRange queryBuildRange,queryBuildRangeEmail;
SysTableLookup sysTableLookup;
//LogisticsElectronicAddress
qbdEmail = query.addDataSource(tableNum(LogisticsElectronicAddress));
queryBuildRangeEmail = qbdEmail.addRange(fieldNum(LogisticsElectronicAddress,DIPL_IsSend));
queryBuildRangeEmail.value(queryValue(NoYes::Yes));
//DirPartyTable
qbdDirparty = qbdEmail.addDataSource(tableNum(DirPartyTable));
qbdDirparty.addLink(fieldNum(LogisticsElectronicAddress,PrivateForParty),fieldNum(DirPartyTable,RecId));
//CustTable
queryBuildDataSource = qbdDirparty.addDataSource(tableNum(CustTable));
queryBuildDataSource.relations(true);
queryBuildDataSource.joinMode(JoinMode::InnerJoin);
queryBuildRange = queryBuildDataSource.addRange(fieldNum(CustTable, AccountNum));
queryBuildRange.value(SalesTable_CustAccount.valueStr());
sysTableLookup = SysTableLookup::newParameters(tableNum(LogisticsElectronicAddress), this);
sysTableLookup.addLookupField(fieldNum(LogisticsElectronicAddress, Locator));
sysTableLookup.addLookupField(fieldNum(LogisticsElectronicAddress, DIPL_IsSend));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment