A Faster OR Search Script
by Matt Petrowsky
12 minutes
Article options
Is it an OR search or an AND search? Do I use more than one field on one request or multiple find requests with multiple fields? These may be common questions if you've not spent a lot of time searching manually through a FileMaker database.
If you're not one to teach your users how to search the FileMaker way, then maybe you should script the whole search process. In fact, that's exactly what many developers do.
From the complex to the simple, there are many ways to script a search in FileMaker. In this video, you'll find out that using a common browse mode feature will help you accomplish some complex searches and do so in such a simple manner. It's the easiest way to make a complex search an easy one, and this includes both users and developer.
Details: Released - 6/4/2007 / Size - 13.14 MB / Length - 12 min
Comments
Use of variable
I'm finding the videos very useful lately - you seem to be going for less advanced topics, which is great (for me). Just wanted to check one thing in this one - in the "Perform Find/Replace" script step, I've used the global itself (rather than putting that value into a local variable first), and it seems to work fine. But am I missing something?
Regards,
Dave.
Using the global directly is just fine
I just use script variables out of habit and practice.
-- Matt Petrowsky - ISO FileMaker Magazine Editor
Trouble when no records are found
I have a problem that the sample doesn't seem to have. When I do a search and no values are returned I get a result that shows no records are found, if I try to perform another search I get the error message "No records are present. To create.." The video implied that if error capture was on then I wouldn't have the issue with no found records, but that isn't working for me. Thoughts? (XP FMA 8.5)
Thanks
Kevin
The error relates to a user action I think
When you get "No records are present. To create..." I'm led to believe that some action is attempting to head into a field which is not global in nature and when there is a zero found set. This error is typically not one which is the result of a script action. Most of the time you see this when you accidentally click in the window with a zero found set.
It may be that a script step is causing this and error capture is not trapping it. Without having tested or have seen the implementation you've got, I would think about adding additional steps to the script that leave the database in a state where the zero found set won't cause the dialog.
-- Matt Petrowsky - ISO FileMaker Magazine Editor
Discovered my mistake
The problem I was having was from the search field not being a global field. Once I changed the field to a global everything work as described. Thanks. These videos are an amazing resource.
Thanks
Technique useable for a lot of records??
I found it a awesome technique,easy to understand and to implement but I wonder if it's useable for a table with lots of records and doing a search on a dozen of records ?
In the db I used it, it took a lot of time. It's a db with 33000 records and did a search over 8 fields.
Discovered my mistake
One of the fields was not on the layout and another was not indexed.
If I corrected these 2 things, it works superfast.
Great technique.
Keep up the good work!!
Bruno
from Belgium
Can this be used in a portal search?
Great technique! I was wondering if there's a way to use this to bring up a found set of portal records.
Video feels very incomplete
Looks like you are skipping a lot of steps.
I'm a beginner (last night was my first day using Filemaker Pro) and I tried to follow this video but here's where I get stuck:
1. After doing the Search and Replace, no script shows up with the code you show under Scriptmaker
2. When I create a global field for the search field, the text field is not editable in find mode. You did not show that step either (creating a global field for the search).
3. The feature where entering keywords in the field above the table runs the search after pressing tab is very cool but how does one do that? Where's the code? I didn't see that step in the video either.
Are there more than 1 videos?