Skip to content


Workaround to get Quick Find found set to return no records if no records are found

The new Quick Find feature in FileMaker v11 is great in that you can use it to quickly find text in any field across all related tables. Just simply place all the fields you want included in said find on a single layout and ensure that Quick Find is enabled for that layout (it’s enabled by default). When using this feature within a script it operates differently than a “standard” find request when the find yields no match.

Here’s what the error dialog looks like in a  standard find request with no match.

Here’s what it looks like after a Quick Find yielding no match.

The fact that the dialogs look differently isn’t much of an issue at least for me as I trap for errors and display my own dialogs. However, the functionality is different in that if you’re scripting your find and desire to show 0 records found on your layout, you need to handle things differently with a scripted Quick Find vs a Standard Find. The standard find with Set Error Capture enabled will properly return 0 records which then allows you to determine this via Get ( FoundCount ) and then properly display the number of returned records. Not so with a Quick Find. It returns the previously found set which means you can’t get the actual count via Get ( FoundCount ) or even Get ( LastError ) = 401 to determine if nothing was found.

The following workaround in your script allows you to determine whether or not 0 records were found via a Quick Find.

As I struggled with this a bit before coming up with the workaround I hope this helps someone else.

Posted in Issues, Techniques, Tips, Workarounds, v11.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Bill Doerrfeld says

    I just discovered this “workaround” isn’t working as the $Error value isn’t returned as expected. (I thought I had tested this part before.) Anyway, my new workaround is to check if find crtieria was supplied and to have a calc which always knows the total count of records and then compare the found count with the total record count and if they’re the same the assumption is that actually NOTHING was found (remember Quick Find returns EVERYTHING if nothing is found). This workaround works for most situations but if search criteria is supplied which indeed correctly yields the ENTIRE found set, then the result is misleading. However, that scenario would seem farily rare and/or such generalized searches basically defeat the whole purpose of searching anyway.

You must be logged in to post a comment.