hi.. Try to pass a valid value in QueryValue and check if the commented code is working.
On Tue, Aug 4, 2009 at 8:03 PM, Girac <girac...@yahoo.com> wrote: > > > Below is the code I'm using, the table does get queried and results are > returned as expected. However, when one is selected the record is > not returned. Do I need another method for that? > > I have looked at the SysTableLookup class on MSDN and Axaptapedia and all > looks correct. What did I miss? > > Regards. > G > > public void lookup() > { > SysTableLookup sysTableLookup = > SysTableLookup::newParameters(TableNum(OrderTable), this); > query query = new Query(); > QueryBuildDataSource qbds; > QueryBuildRange queryBuildRange; > ; > > sysTableLookup. addLookupfield( fieldnum( OrderTable, OrderID)); > sysTableLookup. addLookupfield( fieldnum( OrderTable, Name)); > > qbds = query.addDataSource (tablenum( OrderTable)); > > qbds.addRange(fieldnum(OrderTable, OrderID)); > //qbds.addRange(fieldnum(OrderTable, OrderID)).value(QueryValue(1)); > //***When above uncommented no results are showing > > sysTableLookup. parmQuery( query); > sysTableLookup. performFormLookup(); > } > > --- In > Axapta-Knowledge-Village@yahoogroups.com<Axapta-Knowledge-Village%40yahoogroups.com>, > Anitha S <mail2eani...@...> wrote: > > > > Hi, > > > > Try this code: > > > > public void lookup() > > { > > SysTableLookup sysTableLookup = > > SysTableLookup::newParameters(TableNum,this); > > Query query = new Query() ; > > QueryBuildDataSource qbds; > > Table1 objTable1; > > ; > > > > sysTableLookup.addLookupfield(fieldnum(Table1, Field1)); > > sysTableLookup.addLookupfield(fieldnum(Table1, Field2)); > > > > qbds = query.addDataSource(tablenum(Table1)); > > > > qbds.addRange(fieldnum(Table1, Field1)); > > qbds.addRange(fieldnum(Table1, Field2)).value(QueryValue(1)); > > > > sysTableLookup.parmQuery(query); > > sysTableLookup.performFormLookup(); > > } > > > > Hope this helps. > > Regards, > > Anitha > > > > > > On Tue, Aug 4, 2009 at 2:39 AM, Girac <girac...@...> wrote: > > > > > > > > > > > Hello all, > > > Can someone help me with building a lookup filter on a form? I want to > > > add a new filter to some forms. I have copied the code from existing > > > filter to new one. when i compile I get errors variable not declared, > > > table does not contain this field, etc... > > > > > > I have declared my variable and the error I receive is is "table does > > > not contain this field." > > > > > > Where do I put this table info in my code? > > > > > > If someone can document steps are involved that will be great. > > > > > > > > > > > > > >