2 Replies Latest reply on Oct 2, 2013 2:53 PM by Atkins

    Retaining Global Fields

    Atkins

      Title

      Retaining Global Fields

      Post

           Ok, I can't believe I've never run into this issue before this point, but now I have.  I have a few global fields that I want to be "constant" across all open instances of the file (using FM Server) and that will keep their value when the program is closed and re-opened.  These fields will log the start date and end date of a process, as well as the last user that accessed this process.  That means that they are not true "constants" because they will change, but I only want them to change when I tell them to.

           I would use a standard field which behaves this way by default, but I don't want or need this field to exist across all records.  That's why I was trying to use a global.  I guess one workaround could be to create it in a related table, it's just that my database is so huge and complex with so many related tables that I was trying to avoid another instance.  If that is the only way to achieve this then I guess I'll have to do that.  It sure seems like it would be possible to retain a global field in an existing table though.  I read somewhere that the fact I'm using FileMaker Server might be "clearing" my global fields when I close the file.

           Let me know your suggestions!  Thanks!

        • 1. Re: Retaining Global Fields
          ninja

               Howdy Atkins,

               A global global...yeah, I've been asking for that for a while...

               Rather than a related table, I will simply make a stand-alone table called "Globals".  This table has only one record and it consists of non-global fields.

               On startup, my opening script goes to that table (layout actually) and SetField's the globals I want to the values in that table.  This lets the globals exist across user sessions...not really to exist, but to be re-set on startup.

               You could have the pertinent fields of the "Global" table show up if you wanted to change them...simply open the window showing them, change them, then close the window.

                

               HTH

          • 2. Re: Retaining Global Fields
            Atkins

                 Ninja,

                 I had actually had the exact same thought you did.  But because I was being "lazy" I tried to move the data back and forth from the global fields I had already created to the regular fields in my global table.  This process didn't work.  When I actually changed all my field references in scripts to the regular fields in the global table it works fine.

                 Thanks for the tip!