SearchResults

Searching More Fields

How can I search on more than the fields already on the Table00 Template?

Adding new additional fields is pretty easy.

SearchResults uses the object names of fields on the TableXX layouts to figure out which fields to search on. These layouts have 6 text fields on them by default. If you haven't pointed all 6 at fields in your table then you probably don't need to modify any scripts: you just need to point a few more of these 6 fields at fields in your table. Then those fields will be searched.

If you've already pointed all 6 fields want to search of 7 or more text fields, here is how:

1. Add a new field.' Add a new field to the TableXX layout you're working with. In our example file Table01 is the company layout so if I needed to search on more company field I'd add a new field from Search Table 01 to the layout. (The easiest way to do this is to copy and paste an existing search field because then the context of the field will always be correct.)

2. Give the field an Object Name. Select your newly added field in layout mode and show the Object Info palette (select "Object Info" from FileMaker's View menu). Give the field an object name one higher than the last object name of that type on the layout. For example, if you added a 7th text field, then last one was named "Text06" (without the quotes): name yours "Text07"

3. Edit the Search Script. Edit the script "Search - Perform Find' and find the section for the field type you're adding. In our example we're adding a 7th text field, so I'd find the comment "Data Type is none of the above, must be Text" toward the bottom of the script. Duplicate the 4 lines of script we use for a search and change the object name to reflect your new object. In this example you'd add the following 4 lines (in blue):

That's it!

(855) SEEDCODE
[email protected]
Follow us: