3 Replies Latest reply on Feb 3, 2011 3:16 PM by philmodjunk

    Making a "Search" page

    DonnaZi

      Title

      Making a "Search" page

      Post

      i am trying to modify the lending library starter template, using FileMaker 11. i am making a material library for architectural samples.

      I would like to create a layout (using the "Assets" table) that allows a user to search by 3 or 4 different fields and then press a "search" button at the bottom that takes them to list layout of assets in their found set.

      i am a beginner, so i don't know how to script this appropriately, assign an appropriate script to the search button itself, etc.  

      I've attached a screen shot showing:

      1) the page i laid out, visually, linked to assets table records

      2) the relationships tab

      Any step-by-step instructions would be great! thank you in advance.

      Screen_shot_2011-01-28_at_3.17.57_PM.png

        • 1. Re: Making a "Search" page
          philmodjunk

          You have two basic options available.

          Write a script that brings up this layout and enters Find mode:

          Go To Layout [//your search layout]
          Enter Find Mode[]

          This script can be perfomred from a button to start your search process. Then set up your Search button do this script:
          Perform Find[]
          Go To Layout [//the layout where you want to see the results of your find]

          Some people pause the first script and add a perform Find[] , Go to layout so that continueing the script performs the find and takes you to the results layout.

          A more sophisticated option is to define additional fields, with global storage specified for each of your "search" fields.

          Your first script can work like this:
          Go To Layout [//your search layout]
          Set Field [YourTable::gMaterialSearch ; "" ]
          Set Field [YourTable::gApplicationSearch ; "" ]
          Set Field [YourTable::gVendorSearch ; "" ]
          Set Field [YourTable::gLEEDSearch ; "" ]

          The second script runs like this:
          Go To Layout [//your results layout]
          Enter Find Mode[]//clear the pause check box
          Set Field [YourTable::Material ; YourTable::gmaterialSearch]
          Set Field [YourTable::Application ; YourTable::gApplicationSearch ]
          Set Field [YourTable::Vendor ; YourTable::gVendorSearch ]
          Set Field [YourTable::LEED ; YourTable::gLEEDSearch ]
          Set Error Capture [on]
          Perform Find[]

          I didn't open a copy of the Lending Library to try to figure out correct table and field names, so you'll need to modify these examples to use the actual table and field names used in your database.

          • 2. Re: Making a "Search" page
            DonnaZi

            Great, thanks. option worked well. is there a way to clear the search page when the user returns to it the next time? currently, it "remembers" the last find performed and keeps those search values marked. i'd like it to refresh itself every time someone comes back to the search page.

            thanks.

            • 3. Re: Making a "Search" page
              philmodjunk

              Rember the first script?

              Go To Layout [//your search layout]
              Set Field [YourTable::gMaterialSearch ; "" ]
              Set Field [YourTable::gApplicationSearch ; "" ]
              Set Field [YourTable::gVendorSearch ; "" ]
              Set Field [YourTable::gLEEDSearch ; "" ]

              Those set field steps are there to clear each search field so that the search starts with empty fields. You can even add a second button, Modify Find to run a script that doesn't clear these fields so that the user can see the values entered previously.