5 Replies Latest reply on Jan 15, 2014 9:39 PM by philmodjunk

    Automate Pop-Up Menus

    MattTodaro

      Title

      Automate Pop-Up Menus

      Post

           Hi All,

            

           I'm new to filemaker and was wondering if anyone know if pops-menus can be automatically turned off and on? I have a table that defines a type for a given shot. There can only be one active shot type at a time, so I made a field that has a pop-menu with "Active" and "Notactive". My problem is if I make a new record and set it to active I have to manually set the other the "Notactive". Does anyone know of a way that once a record is set to "Active",  all other records will automatically be sets to "Notactive" ?

            

           Thanks Matt

        • 1. Re: Automate Pop-Up Menus
          philmodjunk

               I would do it by removing that field entirely from your database. Add a button to your layout to click to select a given record as the "active" record. Have that button perform a script that sets either a global variable or global field to the primary key value of the record that  is clicked. Use conditional formatting to show the record whose primary key matches that of the value in global variable/field (the active record) in a contrasting color.

               Layout text that says "active" can also be set to be invisible if on a record whose primary key does not match that of the "active" record. And other text with Inactive can be set to be visible if the record is not selected as the active record.

          • 2. Re: Automate Pop-Up Menus
            MattTodaro

                 Phil,

                 Could you explain what is the difference between a global field and a global value?

            • 3. Re: Automate Pop-Up Menus
              philmodjunk

                   A global variable is created with a set variable script step.

                   Set Variable [$$Variable ; value: 3 ]

                   Assigns the value 3 to the global variable named $$Variable. The two $$ designate this as a global variable. It's value will be accessible anywhere in the file to any script, layout or calculation, but the value will not persist when you close the file.

                   A global field is defined in Manage | Database | Fields where you use field options to specify global storage. The value in a global field is also accessible form any script, layout or calculation but in single user files, the value in the field will persist when the file is closed. And unlike a variable, you can put a field on a layout where the user can edit it and you can use it some types of relationships.

              • 4. Re: Automate Pop-Up Menus
                MattTodaro

                     Phil,

                     Thanks for the great explanation. Could you explain one more thing. How do you set in invisible text?

                • 5. Re: Automate Pop-Up Menus
                  philmodjunk

                       How I do that depends on the version of FileMaker that I am using. In FileMaker 13, I have a setting in the inspector called "hide when" that I can use dynamically hide/reveal a layout object. In earlier versions, I can use conditional formatting to set the font size to a very large size (120+ points for 10-12 point layout text) to make it disappear.