The Symbols Used For Special FileMaker Search Tasks

From Dwayne Wright PMP - Certified FileMaker Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

When you do a traditional find operation in FileMaker, you have the ability to type in or select from a pop-up menu special symbols to get a more flexible result. Some of the symbols you can use are ...

< Less Than
≤ Less Than Or Equal
> Greater Than
≥ Greater Than Or Equal
= Exact Match
... Range
! Duplicates
// Today’s Date
? Invalid Date or Time
and 4 others.


There are quite a few FileMaker users that do not know the power of these symbols. As a FileMaker developer, you can build a customized search screen and incorporate these symbols into it.

First create 4 fields ...

Special Search Operator - Global Text Field
Search Date - Global Date Field
Dates - Date Field
Calculated Search - Calculation ( text result ) - Calculation would be ...
Special Search Operator & DateToText(Search Date)

Next, create two layouts ( Find - in form view for the user to enter in the find requirements ) and ( List - a list view where the results are shown). Put the following fields on the following layouts ...

Find Results Layout
Dates - Date Field

Find Layout
Special Search Operator - Global Text Field
Search Date - Global Date Field
Calculated Search - Calculation ( text result ) - Calculation would be ...
Special Search Operator & DateToText(Search Date)

add a radio button value list to the Special Search Operator field with the following choices ...

>

=
<

Next up, lets write a script that we can attach to a button in the Find layout.

Set Error Capture [ On ] just in case no records are found
Go To Layout [ FIND ] just in case the user was elsewhere
Copy [ Select, “Calculated Results”] this is the field that has all our search settings
Enter Find Mode [ ] here we are starting our Find
Paste [ Select, “Dates”] just like typing in our find with the parameter
Perform Find executes our search
If [ Status(currenterror) = 401”] this is the error code for no records found
Show Message [“Whatever you want to say”] tell the user what happened
Go To Layout [“FIND”] take the user back to a usable screen
Set Error Capture [ On ] just in case no records are found
Else signals the end of error found script steps & goes to found record steps
Go To Layout [List Results] show the user what the search came up
End If now we are done with the error checking operation

WRAPPING THIS UP
What we want the user to do is ...

Pick An Operator ... such as Greater Than >
Enter In A Date ... such as 1/3/2002
Click The Find Button
View The Results

An example file can be downloaded by clicking (here)

© 2010 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.