Hi all,
I have a customized form where i have lookup with certain conditions with Table A and Table B.
Lets say for example, In table B, there are two fields, customer account and customer parts.
For one customer account there are 'N' number of customer parts.
My requirement is to lookup the values of customer parts based on the customer account selected.
So, in the lookup method of Table A field, i have the below code.
public void lookup(FormControl _formControl, str _filterStr)
{
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource QbdsJoin;
QueryBuildRange qbr,qbr1;
TableB tableB;
str 64 filterStr;
SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(TableB), _formControl);
;
// Create the query.
qbds= query.addDataSource(tableNum(TableB));
while select forceliterals tableB
where tableB.CustAccount == TableA.CustAccount
{
if(tableB.extItem != "")
{
qbds.addRange(fieldNum(TableB,ExtItem)).value(tableB.ExtItem);
qbds.addSortField(fieldNum(TableB,ExtItem));
qbds.orderMode(OrderMode::GroupBy);
query.literals(true);
}
}
sysTableLookup.parmUseLookupValue(true);
sysTableLookup.parmQuery(query);
sysTableLookup.addLookupfield(fieldNum(TableB,ExtItem));
sysTableLookup.performFormLookup();
}
Before using forceLiterals, i got the Binding Operation failed too allocate buffer space error.
So i used forceLiterals in the select statement, then i get the error like, Cannot select a record in TableB. SQL issued an error.
The table is in proper Sync, but yet i receive this error.
Any Suggestions appreciated.