8 Replies Latest reply on Nov 28, 2011 6:38 PM by KylePutzier

    Single Record Global Question

    KylePutzier

      I want to create a table with a single record that is designed to collect user information in a FMS multi-user situation. The info will be collected via various buttons on the layout that will populate a log table.

      If one user populates a global (that is related to another table) and anoher user populates the same global, in the same record, with a different value, will both users see the correct data from the related table?

       

      Kyle

        • 1. Re: Single Record Global Question
          reelsteve

          Hello Kyle,

           

          Globals are unique animals.  They are seemingly straightforward

          but have a few unique attributes that I wasn't aware of for embarrassingly , years.  Globals are unique to each user so in term of their use to key values fr related tables, 2 sep users can populate the same global without worry that one user's data will interfere with the other's key value (and thus , affect what related table data they would see).  That is just part of the global story.  Here are a couple of other aspects.

          When used in a solution being served by FMS, they will always revert to their originally set value when a user ends the session. In order to change the original value - the solution must be opened directly and the value set.  Then , and only then, will the global value persist beyond the file being closed as it is the only time it is written to the file.  Any data u want in a global field needs to be loaded at startup or reinserted by users each time they access the solution.  So if u want to use Globals to key data in related tables and u want it to be specific to each user, u need to write it to a profile record or some other non global field and load it on session startup when user logs in.  

          One more tidbit I recently learned which may help lock in the definition of a global.   Rather than creating user accounts in the database, I wanted to make a userManager solution to manage users so I cld control a much wider spectrum of their experience.  Because there is a limited amount of control over user account functionality, the only way to do what I'm describing is to make a short list of fm accounts e.g level 1, level 2, level 3 usually to create security classes or permission tiers and then have users log in to the manager who in turn logs them in automatically to the destination solution thru the conduit of one of the fm accounts.  This means that all users are being ushered thru 3 or 4 fm accounts.  I assumed (wrongly) that this meant saying goodbye to Globals.  After all , Globals are specific to users and what I'm doing is letting 50 people in with one movie ticket stub so they will certainly step on each others experience.  What I learned is that Globals are not specific to users, they are specific to filemaker sessions as defined by the moment a login occurs until the session ends.  Every session is a virtual event on the server and it prepares sep Globals for each virtual event then throws them away when u leave.

           

          Globals were once again awesome for me in that moment.  It pays to befriend Todd Geist !!  

           

          Hope that helps.

          ------

          s t e v e

          • 2. Re: Single Record Global Question
            KylePutzier

            Steve,

             

            My question is difficult to define (at least by me). I am aware of the behavior and persistence of globals. I am just not sure of what will happen when many users use the same record at the same time. The info displayed will depend on what is entered in a global field by the users. I suspect that the data displayed will be unique to the user and the other users data will be unique to them. Before I do a lot of work, I am hoping for some confirmation. I have no way to test it at the moment.

             

            Kyle

            • 3. Re: Single Record Global Question
              Mike_Mitchell

              Kyle -

               

              Yes, the joins will resolve on a by-user basis. I've done this myself on several occasions.

               

              Mike

              • 4. Re: Single Record Global Question
                Stephen Huston

                Hi Kyle,

                 

                Globals are unique to each user. Make both the data global AND the local calculations globally stored, and each user will have their own experience, no matter how many users are in the system at once.

                 

                If the global(s) determine a realtionship key, they will each also have their own set of related records based on those global keys.

                • 5. Re: Single Record Global Question
                  KylePutzier

                  Mike, Stephen,

                   

                  Thank you. That confirms it for me. I just wasn't exactly sure about the single record interaction. I wont be using the record at all other than the fact that there MUST be a record to interact with the layout at all.

                   

                  Kyle

                  • 6. Re: Single Record Global Question
                    KylePutzier

                    Stephen,

                    I have a local global calc that is referencing data 2 relationships away and is not updating when I change the local global key. If I change the local global calc to unstored, it updates as expected. Will users still have their own experience?

                    or

                    Why does it not update?

                     

                    Kyle

                    • 7. Re: Single Record Global Question
                      Mike_Mitchell

                      Kyle -

                       

                      Try this solution from the archive:

                       

                      https://fmdev.filemaker.com/message/33005#33005

                       

                      Mike

                      • 8. Re: Single Record Global Question
                        KylePutzier

                        Thanks Mike,

                        I am finding that I use auto entered calcs more and more. It always suprises me that I can't think of the answer before I ask for it.

                         

                        Now that I think about it, since I am updating the local global key via a script, I could have just have done the same with the value I am trying to get via a calc.

                         

                        15,000 ways to solve any one problem. That is why I cant think of it before I ask.

                         

                        Thank you all,

                        Kyle