SearchResults

Integration

Adding fmSearchResults to Your File

You can add fmSearchResults to your file in just a couple of minutes. Begin by backing up your file (always a good idea) and then follow the instructions below. Experienced developers can just follow the quick version; if you need more help check out the detailed version below.

(Note that you'll need the purchased--and unlocked--version of SearchResults in order to add SearchResults to your file.)

Need Help?

Our products are designed so you can integrate them into your own FileMaker solutions yourself following the instructions in our online documentation, and our team is happy to provide any guidance you need at no additional charge. So please don't hesitate to reach out if you get stuck--we can likely get your integration unstuck with a quick phone call or email.

Alternatively, our trained and certified developers can do your integration for you from start to finish. Just pick up our minimum three-hour implementation package ($570) and send us your file (more complex integrations may require more time).

We can also help you build custom features in any FileMaker solution that involves one or more of our products, including customized deployments of SeedCode Complete. For these types of projects that involve custom-built features, please get in touch to discuss the details so we can give you an estimate of the cost and timeline.

Quick Version

1. Import or paste the SR_SearchResults table into your solution. If you're using the Separation Model, paste this table into the Interface file, not the data file.

2. Find the "SR_SearchResults" layout in your solution created when you completed step 1, above. Delete everything on this layout, leaving only the body part.

3. For each table you want to search in, create a layout called Table01, Table02, etc. Link the layout to the same table occurrence you use for your main detail layout for that table.

4. Import the 'SearchResults' script folder into your solution.

5. Edit the script "Integration Settings", following the instructions in the script comments.

6. Copy and Paste the contents of one of the Results layouts into the "SR_SearchResults" layout in your file.

7. Copy the contents of the Table00 Template layout. Paste into Table01 in your solution. Double-click each object, choose the field in your solution that matches the data type. Ignore fields you don’t use. Repeat for Table02, etc. Don't delete fields you may not need, just leave them unreferenced.

8. Paste the search widget from the upper right of fmSearchResults on to any layout in your solution.

9. Close this file (fmSearchResults) – You no longer need it. Try a couple searches and checkout our troubleshooting page if you run into problems.

Detailed Instructions

1. Adding one table. Backup your file and then open fmSearchResults.

If you're using FileMaker Advanced, enter File / Manage / Database, select the Tables tab, and copy the table SR_SearchResults. Move to your file, selecting the Tables tab from Manage / Database in your file and paste the SR_SearchResults table into your file. That's it for that table.
If you're not using FileMaker Advanced, create a new table in your file named "SR_SearchResults". Then create your versions of the four global text fields you'll find in the SR_SearchResults table in fmSearchResults. Make sure these fields are named exactly as they are in fmSearchResults, and make sure they have the same number of repetitions as they do in fmSearchResults as well. There are only four fields to make so this won't take much time.
If you're using the Separation Model (where you have different interface files from your data files) add this table to your interface file, not your data file.

2. Find the Table Occurrence on the Graph. Creating the table in step 1 above will place a table occurrence on your graph called "SR_SearchResults". Take a moment to locate it, and leave it alone. Do not rename it.

3. Create Two Layouts. At the end of this step you'll end up with three blank layouts in your file, deleting the header and footer part from each as you create them.

Begin by finding a layout named "SR_SearchResults" that was created automatically in step 1 above. Delete everything on this layout, leaving only the body part.
The next two layouts will be based on the table occurrences you'd like to search on. In this example we'll be searching a table occurrence called "Contacts" and one called "Projects". So create a layout named "Table01" where "Show Records from:" is set to the first table you'd like to search: Contacts in our example. Select the layout type "Blank Layout" and delete the header and footer from the layout as soon as it is created. Create a second layout the same way based on the second layout you'd like to search--Projects in our example--and name this one "Table02".
Don't worry about searching more than two tables right now: you can easily Add More Tables to Search once you have this up and running in your file.

4. Import Scripts. Open Scripts or ScriptMaker in your file and click the Import button at the bottom of the screen. Select fmSearchResults as the file to import from, and click the checkbox next to the Search Results folder. Click OK and you'll have imported all the relevant scripts into your file. Don't worry about the error at this point.

5. Edit the 'Integration Settings' Script. Open Scripts or ScriptMaker in your file and find the newly imported "Integration Settings" script. You'll edit several sections of this script to teach SearchResults about your file.

What is your file name The first setting you need to change s a variable the contains the name of the main window in your file. This is most likely your filename without the ".fp7" but could be a window name if you're using custom window names. In our example this is the name of the file, like this:
Name your contexts This section contains 4 variables that tell SearchResults what you'd like to call each of the contexts/tables you'll be searching. Rename the first two and leave the last two alone or mark them as "NA". In this example, we're searching Projects and Contacts, so our script would look like this:
Select your layouts (form view) In this next section of the script, you'll see some Go To Layout "unknown" steps. For each, tell the script which layout you'd like to use when viewing a single record from each context: so when clicking on an individual result for a contact, in our example, which layout would you like to use. You can leave additional contexts as "unknown" like this:
Note that there is a Go To Related Record step here: this is used to show "related" records as results such as when you might be clicking on a Phone Number result, but wish to land on that number's related contact. See showing related results for more information on making use of this down the road.
Select your layouts (list view) Continue into the next section, selecting the List View layouts you'd like to use when clicking on things like "...and XX more Contacts".
Select a Skin In the next section you can specify which layout to use to display your results.You can eventually have different layouts each with their own look or "skin" but for now, select the layout "SR_SearchResults" that was created in step 1.
Save the script The other settings in this script can be changed later once you're up and running.

6. Copy and Paste Layout Contents. Now you'll copy the contents of the layouts in fmSearchResults, and paste them into your layouts of the same name.

Begin with the "Results - Simple" layout in fmSearchResults (or any of the results layouts you like the look of): enter layout mode and select all, the copy the contents to your clipboard. Go to the "SR_SearchResults" layout in your file and paste. FileMaker will ask if you want to enlarge the layout. You do. If the layout looks different than the one in fmSearchResults while still in layout mode, you may need to change your View Options. Select View / Show and uncheck "Sample Data".
Now you'll copy and paste the Search layouts where the real work is done. Continue the same way, copying the contents of the Table00 Template layout, and pasting it into the Table01 layout in your solution. Now move to the Table02 layout and paste the Table00 Template layout contents there as well, agreeing if FileMaker wants to enlarge the layout.

7. Editing the Search Layouts. Begin on your Table01 layout. You'll want to double click on each of the search fields, pointing these at their counterpart in your file. In our example we're searching on a Contacts table for Table01 so we'll need to point these fields at fields in our "Current Table (Contacts)".

Begin with the Unique ID Field in the upper left: double click on the (now empty) field there and point his field at the unique ID in the Current Table. In our example, this would be the unique ID field in the Contacts table.
Next move to the Display Fields to the right: these are the fields that will show up in your list of search results to describe each found record. Double click on one or more of these display fields and point them at fields from the current table. In our example, I want to see the Contact's name, state, and phone number, so I'd select those three as my display fields. Just leave fields you don't need alone, and do not copy and paste new fields on to this layout: at least not yet. Once you're up and running you can learn more about editing and extending these search layouts here: Search Layout Tips. These display fields are the only ones you'll want to perhaps point to related fields: for example, in our example my addresses are in another table so for my second field I may select "ContactAddressMain::State". Don't delete fields you don't need; just leave them alone.
Move on the Text Fields: these are the fields we actually search. pick one or two for now, leaving any fields you don't need to search on alone for now. Don't delete them. In our example I'm going to pick Contacts::FullName and Contacts::Notes. Remember, these are the fields you're searching on, so don't select related fields here. If you need to search a related table you'll create a table for it and search it directly, setting it up so when you click on a related result (like a phone number) you go to the related contact record.
Note that you can create a display calc in the current table that creates a beautiful display string for you--something with some nice text styles, colors, and formating--and you can use that as Display Field 1, leaving the other two alone. See Formatting Results for more info.
Next move on to the Number, Phone, and other fields, pointing these at those fields from the current table that you'd like to search on. Again, leave any of these blank for now as you can return to them later. All that is required for SearchResults to work are the Unique ID, one Text Field, and one Display Field.
Once you have the Table01 layout set, do the same for the Table02 layout, starting with the Uniqie ID and Display Fields, and always pointing the fields at fields from within the Current Table.

8. Paste in the Global Search Widget Copy the search widget from the upper right of SearchResults and paste this on to any layout in your solution. It is set to slide (object resizing) to the upper right, so you may want to position it in the upper right of your layout as well.

9. That's it! Close "fmSearchResults". Enter browse mode and type some criteria into your search widget on one of your original layouts to see how this works. Try a couple searches and checkout our troubleshooting page if you run into problems.

(855) SEEDCODE
[email protected]
Follow us: