2 Replies Latest reply on Feb 18, 2011 3:12 PM by philmodjunk

    Simple  Popup window to select Find criteria

    JoelCornette

      Summary

      Simple  Popup window to select Find criteria

      Product

      FileMaker Pro

      Version

      11

      Operating system version

      Mac os x 10.6

      Description of the issue

      Looking for simple way to have a popup window to "jump" up over current window and prompt for Find where the user can select criteria from a previously defined Drop box list.  I can  perform the process manually with another layout that I switch to, perform a Find, then go back to the previous layout.  Like to see if I can do this in a popup window.

      I have attempted to create a script with New Window for the popup that has a Go to Layout with a blank Drop box list on, and enter Find mode .. however, when executed it does not work for the Window in the background -- only works for the front window the popup.  Using Select Window in the script just moves the window contents to the popup. 

      Basically, have a set of records with a field values "Lions, Tigers and Bears" and like to do a popup that help find only records with say, "Lions" ... where Lions is selected via a List from the popup. 

      Thanks ...

        • 1. Re: Simple  Popup window to select Find criteria
          TSGal

          Joel Cornette:

          Thank you for your post.

          Each Window you open allows you to perform separate finds.  That way, you can keep your current record, open a new window, do some searching, and then return to the original window.

          One option is to use a global field pop-up, take the value and perform a Find on the original window.  One way to do this is to create two separate scripts:

          Script A
             Set Field [ <global field> ; "" ]
             New Window []
             Show/Hide Status Area [ Hide ]
             Go to Layout [ <layout that only contains global field> ]
             Move/Resize Window [ Current Window ; Height: 200 ; Width: 300 ; Top: 200 ; Left: 200 ]

          This script sets the global field to null (to start a new search), opens a new window, hides the status area, goes to a layout that only displays the Global field and sizes it to a smaller size.  Set the Global field to a pop-up with the value list "Lions, Tigers and Bears"; the same as your other field.

          On this new Layout, also have a button to execute a script that takes the value from the global field and finds the records.  For example,

          Script B
             Close Window [ Current Window ]
             If [ IsEmpty ( <global field> )
                Halt Script
             End If
             Set Variable [ $var ; Value: <global field> ]
             Enter Find Mode []
             Set Field [ <your pop-up field> ; $var ]
             Perform Find []

          This script closes the current window.  Since we entered the information into a Global field, its contents will be available in all windows.  Therefore, we check to make sure an entry was selected.  If not, we halt the script and you are left off where you originally started.  Otherwise, we put the contents of the global field into a variable $var, enter Find mode, put the variable into the pop-up field and perform a find.  For example, if you had selected "Tigers" from the pop-up, you will now only see the Tiger records.

          Let me know if you need clarification for any of the above steps.

          TSGal
          FileMaker, Inc.

          • 2. Re: Simple  Popup window to select Find criteria
            philmodjunk

            If you download this file: You'll get a demo file that pops up several such floating windows--including one for Find and also Modify Find. The scripts they use are a bit more sophisticated than the above example by TSGal, the scripts use an infinite loop to make sure the floating window stays at the front and keeps the user from interacting with any other windows until they either perform the find or close the window. There's also data being passed as script parameters from the buttons being clicked. That's how the same script can do either a Find or a Modify FInd.

            The script also checks to see if this is a windows platform and takes steps to minimize the window resize issues that can take place on a Windows system with this type of script.

            Be sure to examine the loop part of the script and make sure you have a button that uses halt script to interrupt this loop or you can get trapped with the find window up and no way to do anything else until you force quit FileMaker.

            http://www.4shared.com/file/8orL8apk/FMP_Bugs.html