7 Replies Latest reply on Feb 21, 2009 1:23 PM by Greg123

    Globals on a Network

    Greg123

      Title

      Globals on a Network

      Post

      FMP 8.5 with latest update  

      I have a file shared between two computers - host and 1 client. Host is XP and client is Vista

      I have a global field called "Next Deposit"

      When a user enters a new payment, the deposit date is pulled from the "Next Deposit" field

      Then I do a find for the date and print a list of the cheques.

      Then I manually change the "Next Deposit" to some date in the future on both machines.

      This system has been working great for years.

       

      My problem started when I got a new machine with Vista.

      Now after I have changed the "Next Deposit" date on both machines it stays as it should UNTIL the client machine closes and opens the file at which point the date reverts to the previous value.


      I have read some other posts about global values being session specific and I understand that to mean that when the client opens the file (a new session) it should take the current value from the host.

       

      Can anybody explain this behavior?

      Thank you in advance

        • 1. Re: Globals on a Network
          ninja
            

          howdy Greg123,

           

          I'm sure someone can explain better than I, and I'll leave it to them to do so.  What I can give (if you haven't already done this yourself) is an easy ruggedness-option that fits your decribed situation.

           

          In your opening Script (if you don't have one, start one), have the first command be "Setfield [globalfield;"2/13/2009"]

           

          globalfield = the global field you are asking about in your post

           

          Now you don't have to change the global field every time, you just change the date in your script.  And everytime you start a new session on either computer, the session starts with the global field being set to the correct date.

           

          A brute force workaround, true.  But it works in my dbases everyday and I don't have to keep track of which machine changed the globals.

           

          hope this helps a little...

          • 2. Re: Globals on a Network
            Sorbsbuster
              

            We've all had variations of your theme, I think, where the concept of 'Local globals' and 'Global globals' catches us all out (post a 'Feature Request' and join the vote!), but I've never had the exact one you have where the local session doesn't seem to either retain its own or pick up the server's global value.

             

            To use Ninja's solution without having to open and change a script, I use a single-record 'Preferences Table' that all tables relate to via a Constant (ie: has the effect of a global, or 'X' relationship), and I set the variable (date in your case) there.  Then I use the StartScript to grab the value from there.

             

            It's the same solution as Ninja's, only without going into ScriptMaker.

             

            Alan.

            • 3. Re: Globals on a Network
              ninja
                

              Sounds pretty slick Sorbs,

               

              I always wanted to do that, but couldn't figure out how to find the right record the data was on...I couldn't really set it to "global" after all.

               

              So you made a whole table, just to house a single record, and that record has the "global holders".  Can't believe I didn't think of that, and I'm glad you did.  Thanks for sharing.

              • 4. Re: Globals on a Network
                davidhead
                  

                Sorbsbuster wrote:

                 

                To use Ninja's solution without having to open and change a script, I use a single-record 'Preferences Table' that all tables relate to via a Constant (ie: has the effect of a global, or 'X' relationship), and I set the variable (date in your case) there.  Then I use the StartScript to grab the value from there.

                 


                I used to do that Alan. But then I got tired of setting up cartesian joins everywhere. This is how I do it now (from another related post):
                4. Use a 'globals table' where you have one record with standard fields and a corresponding calculation field for each that is stored as a global. For example, you would have a text field called CompanyName and a calculation called CompanyNameGlobal which = Companyname. 
                You can use the global values in any table without there having to be any direct relationship to the globals table. Cool hey? 

                 


                • 5. Re: Globals on a Network
                  TSGal

                  Greg123:

                   

                  Nobody really answered your question, "Can anybody explain this behavior?", so here is an explanation.

                   

                  Suppose User A logs on to the database file and sets the global field to a value "A".  User A may then use this value in a calculation or within a script.  Now, User B logs on to the file and sets the global field to a value "B".  If User A started seeing "B" in the calculations, there would be some confusion.  Now, imagine User C and User D logging on and setting values.  There could be massive confusion if the value was shared by everyone.  That is why guests have individual global values.

                   

                  The only way to change the initial global value is from the host.  If the host is FileMaker Server, then you have to close the file, reopen the file locally using FileMaker Pro and change the value, close the file, and then open it back again on Server.

                   

                  One option is to create another table that contains one record and fields for each of the global fields in the other table.  Using a startup script, one can use the Set Field script step to grab the value from the second table and replace the global field in the original table with the value from that second table.  This would then allow you to set the initial global value at any time.

                   

                  TSGal

                  FileMaker, Inc. 

                  • 6. Re: Globals on a Network
                    Sorbsbuster
                      

                    Thanks, David - I'll do that next time!

                     

                    Alan.

                    • 7. Re: Globals on a Network
                      Greg123
                        

                      Thanks to everybody for their input.

                      I will set up a preferences table and grab the value from there.

                      Cheers

                      Greg