Reduce the foundset when using find

Hi all,

is it possible to perform a find on a foundset without enlarging its size? I know the search method accepts two parameters but I can’t seem to reach my goal. Basically I’ve got a form’s foundset loaded with records from another one. Then I save a single record in the foundset; afterwards I need to ‘remove’ the saved record. Not to delete it, beware. I tried omitRecord but it only gave me an empty foundset. When using find instead I also obtain records not present into the original foundset, though satisfying the search conditions. Am I doing something wrong?

Hi,

Normally, a foundset is bound to a table and reflects the contents of the table. If the table has 5000 records the foundset will show the first 200 records. If you apply search criteria it will show the first 200 records that meet you search criteria. When you go to the last record it will retrieve the next 200 records. This is all familiar I am sure.

If you have done a find/search and want to do another one, thereby keeping the previous searchresults and narrowing down your selection to the specified criteria, you can do it like this:

// first search
controller.find();
foundset.city = 'New York';
controller.search();
// second search
controller.find();
foundset.name = 'Smith';
controller.search(false, true);  // clear last results = false; reducesearch = true

Of couse these search criteria could have been specified in one search operation but you get the point. An example of expanding the search is when you also want to find city=‘New Jersey’. In that case set the second parameter to false.

Another option you have to reduce the results, is to use foundset.addFoundsetFilterParam(). If you want to reduce the results in both foundsets you could use databaseManager.addTableFilterParam().

If you want to show different results in both foundsets, and they are based on the same table then set namedFoundset to -seperate-.

I hope this helps.

That surely helped, though my problem is a little differente in that I don’t have any previous find going on upon the foundset, so the reduce options simply don’t work…I solved with a shift in design, i.e. instead of hiding the saved record I just skip it when moving around the foundset. Probably not the most efficient way, but anyhow…

In that case an addFoundSetFilterParam() that filters out the record you want to ommit should do the job.

Kind regards,

omar:
In that case an addFoundSetFilterParam() that filters out the record you want to ommit should do the job.

Kind regards,

We tried that too, but than calling loadRecords/loadAllRecords gave the same result as the find approach.