3 Replies Latest reply on Jul 23, 2009 2:55 PM by donjuancarlos_1

    Persistent global variable in a multi-user environment

    donjuancarlos_1

      Title

      Persistent global variable in a multi-user environment

      Post

      How do I make a global variable that is not user-specific in a multiuser environment--one whose value doesn't reset when a user closes Filemaker?

       

      For example, I want to have a global variable that keeps track of the current quote number in my quotes database.  I would use an incrementing serial number but I allow users to create "revisions" so multiple quotes can have the same quote number--so therefore I can't use a serial number.

        • 1. Re: Persistent global variable in a multi-user environment
          etripoli
             One option would be to store it in a 'main' table, that only has one record, and fields to store this type of shard info.  On the otherhand, maybe you want to split your actual quotes, and revisions, into a separate table, separate from the table that contains the quote number.
          • 2. Re: Persistent global variable in a multi-user environment
            mrvodka
              

            donjuancarlos wrote:

            How do I make a global variable that is not user-specific in a multiuser environment--one whose value doesn't reset when a user closes Filemaker?

             

            For example, I want to have a global variable that keeps track of the current quote number in my quotes database.  I would use an incrementing serial number but I allow users to create "revisions" so multiple quotes can have the same quote number--so therefore I can't use a serial number.


            Regardless of your quote number, you should be using a meaningless auto-incermenting KEY as your primary ID.

             

             

            You can not keep a variable outside of its session by definition of the global variable. You can though store the value of the global variable into a user specific record in a users table.


            • 3. Re: Persistent global variable in a multi-user environment
              donjuancarlos_1
                

              I do have a meaningless ID field. I tried the other way first and ran into some other problems... :)

               

              OK - no global field.  I don't need to store user specific data, so I took etripoli's suggestion and created another table with a single database entry in it with the current Quote number.  I then joined the tables with an X join, and it seems to be working OK.  Thanks for your guys's help.http://forum-en.filemaker.com/fm/view_profile?user.id=4145