3 Replies Latest reply on Sep 21, 2012 9:26 AM by philmodjunk

    Perform Find based on value selected from drop-down menu

    Terri

      Title

      Perform Find based on value selected from drop-down menu

      Post

           Hi,

           I'm trying to create a script that will perform a find based on a chosen value from a drop-down list. I am hoping I don't have to give all the information from my field names, etc but know that the value list is on one layout and then I want the value chosen to be found on another layout. 
            
           I'm up against a tight deadline so I was hoping someone could give an example that currently works and I can try to emulate it. If it is vital that you have more information, please let me know. Thanks!

        • 1. Re: Perform Find based on value selected from drop-down menu
          philmodjunk

               Set up a field with global storage for your drop down menu. Use the OnObjectSave Trigger or a button next to the field to perform a script that performs the find. The data in a global field can be accessed by your script when in find mode and from any layout in your file.

               The basic script for this looks like this:

               Go to Layout [Layout you want to search on]
               Enter Find Mode []----> celar the pause check box
               Set Field [YourTable::YourField ; YourTable::GlobalField]
               Set Error capture[on]---> keeps dialog from interrupting script if no records are found
               Perform Find []
               IF [ Get ( FoundCount ) //use if statements with Get (FoundCount) to determine if 0, 1, or many records were found and have your script take the appropriate action for each ]

               To see examples of many different ways set field can be used to specify search criteria go to this link: http://forums.filemaker.com/posts/ba7347f58a and check out the sample script posted near the start of this thread.

          • 2. Re: Perform Find based on value selected from drop-down menu
            Terri

                 Perfect, thank you.

                 One other quick question. If I select Prohibit modification of Value during Data Entry will fields still update when I do the matching import?

            • 3. Re: Perform Find based on value selected from drop-down menu
              philmodjunk

                   Yes. data entry is specified as a user editing data on a layout. Scripts can still modify the value and so can data imports.