public void lookup(FormControl _formControl, str _filterStr)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
;
switch(unitMasterSetup.AccountType)
{
case Accounttype::Ledger :
sysTableLookup = SysTableLookup::newParameters(tableNum(MainAccount),_formControl);
sysTableLookup.addLookupField(fieldNum(MainAccount, MainAccountId));
sysTableLookup.addLookupField(fieldNum(MainAccount, Name));
queryBuildDataSource = query.addDataSource(tableNum(MainAccount));
queryBuildDataSource.addSelectionField(fieldNum(MainAccount, LedgerChartOfAccounts));
MainAccount::addSecureRangeForChartOfAccounts(queryBuildDataSource);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case Accounttype::Bank :
sysTableLookup = SysTableLookup::newParameters(tableNum(BankAccountTable), _formControl);
sysTableLookup.addLookupField(fieldNum(BankAccountTable, AccountID));
sysTableLookup.addLookupField(fieldNum(BankAccountTable, Name));
queryBuildDataSource = query.addDataSource(tableNum(BankAccountTable));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
Default : Error("Unknown account type.");
}
}
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
;
switch(unitMasterSetup.AccountType)
{
case Accounttype::Ledger :
sysTableLookup = SysTableLookup::newParameters(tableNum(MainAccount),_formControl);
sysTableLookup.addLookupField(fieldNum(MainAccount, MainAccountId));
sysTableLookup.addLookupField(fieldNum(MainAccount, Name));
queryBuildDataSource = query.addDataSource(tableNum(MainAccount));
queryBuildDataSource.addSelectionField(fieldNum(MainAccount, LedgerChartOfAccounts));
MainAccount::addSecureRangeForChartOfAccounts(queryBuildDataSource);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case Accounttype::Bank :
sysTableLookup = SysTableLookup::newParameters(tableNum(BankAccountTable), _formControl);
sysTableLookup.addLookupField(fieldNum(BankAccountTable, AccountID));
sysTableLookup.addLookupField(fieldNum(BankAccountTable, Name));
queryBuildDataSource = query.addDataSource(tableNum(BankAccountTable));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
Default : Error("Unknown account type.");
}
}
No comments:
Post a Comment