Page 1 of 1

Search results missing when sorting search results

PostPosted: Fri Oct 02, 2009 10:07 am
by phcranston
I have integrated fmSearchResults successfully. We are search seven tables with no problems.

I attempted to add sorting to the search results by editing the "Create Results Lines" script. I wanted to sort my contact results (Table 2) so I edited param 2 to sort by the name field in my contacts table.

When I ran the search the results were sorted but some of the results were missing. For example, if there were five name results it would say "showing 1 to 5 of 5 but it would only list three. If there were more than 10 it would say showing 1 to 10 but only show 9. If there were 6 it would only show 1.

This happened with multiple tables. I verified that I was indeed sorting by a field located in the table.

When I cleared the sort from the script, the issue continued until I quit the file and then reopened the file. At that point it worked normally, but of course was not sorting.

Any help or insight would be appreciated.

Update - happens in Demo file as well.

PostPosted: Fri Oct 02, 2009 10:41 am
by phcranston
I tried this in the unlocked demo file that comes with the fmSearchResults script and the same issue occurs.

Set the "Person" table to sort by display name and records will be missing.

Resolution

PostPosted: Mon Oct 05, 2009 12:31 pm
by phcranston
I received the answer via email from John Sindelar so I thought I would post it here for others.

If you sort the results, you need to put a "Go to Record/Request - First" script step immediately following the sort script step. That will resolve the issue.

PostPosted: Mon Oct 05, 2009 2:14 pm
by John Sindelar
Thanks Patrick! We added a note about this to the documentation on sorting here: http://www.seedcode.com/pmwiki/pmwiki.p ... ts.Sorting