public void lookup()
{
CustTable custTable;
SalesTable salesTable;
Query query = new Query();
SysTableLookup sysTableLookup;
LedgerDimensionAccount ledgerDim;
ledgerDim = DimensionStorage::getDynamicAccount(LedgerJournalTrans_AccountNum.valueStr(), LedgerJournalACType::Cust);
custTable = CustTable::find(DimensionAttributeValueCombination::find(ledgerDim).DisplayValue);
super();
// Only user defined dimensions will have a financial tag category
select firstonly CustAccount from salesTable where salesTable.CustAccount == custTable.AccountNum;
sysTableLookup = SysTableLookup::newParameters(tableNum(SalesTable), this);
// Add name field to be shown in the lookup form.
sysTableLookup.addLookupfield(fieldNum(SalesTable, SalesId));
sysTableLookup.addLookupfield(fieldNum(SalesTable, CustAccount));
query = new Query();
query.addDataSource(tableNum(SalesTable)).addRange(fieldNum(SalesTable, CustAccount)).value(queryValue(custTable.AccountNum));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment