2 Replies Latest reply on Jun 3, 2013 12:03 PM by James_L

    Direct Input of a Global Variable



      Direct Input of a Global Variable


           I'm running a script from a layout, and the script requires a global variable $$Instrument_Type that must be set by the user.  It's being set from a variable list "Instruments."  

           What I want is a dropdown list (on the layout that spawns the script) so I can choose the instrument type and set that variable, but of course you can't use a dropdown that isn't bound to a specific field and record.   I don't want to change any records, so that's not a good option. 

           In MS Access (ugh), we had a useful feature called an unbounded field that would let me do just that: enter the data I wanted in a control without affecting any records.  I could then pass that into a variable or retain it for a calculation or find or whatever.  

           What's my best bet in Filemaker for using a dropdown list to set a global variable?

        • 1. Re: Direct Input of a Global Variable

               Use a field with global storage specified. Not only can you input data into the global field, you may find it simpler to use the global field in place of the global variable though you can use set variable to copy the value into a variable if you prefer.

               Fields with global storage specified can be accessed from any script, layout or calculation in your file (no relationships need be defined to access them). Unless used as a match field in a relationship, I define them all in a single table of globals to better keep track of them.

          • 2. Re: Direct Input of a Global Variable

                 Thanks, Phil.  Helpful as always.  

                 For once I think Access has the more elegant solution, but this works fine.