12 Replies Latest reply on Feb 26, 2013 8:31 AM by philmodjunk

    Global Storage

    melshamamyan

      Title

      Global Storage

      Post


           Hi,

           When I set a field in my database to be a global storage (one value for all records), it is there while I am in filemaker, but if I close the program and re-launch it the text in that field is gone.

           For example it is the terms and conditions for one of our estimates and I want our employees to be able to copy and past it into another field (terms and conditions 2) so they don't have to retype it everytime and they can make changes as needed without effecting the global storage.

           I don't know if there is a maximum number of characters that it can only remember but there is more then 255 characters in that field.

            

           Any ideas?

           Thanks.

        • 1. Re: Global Storage
          davidanders

               Opening database on one computer? or a hosted database?

          http://www.filemaker.com/help/html/create_db.8.20.html

                                                                           
                              
            •
                         
                              
                                   If your file is shared, only the host's changes to global field data are saved. Changes are saved only when the file is closed.
                         
                                                                                                               
                                   
            •
                              
                                   
                                        If a file is shared, some calculations that include global fields are evaluated on the host instead of on the client. The host performs the evaluation in the following situations:
                              
                                                                                                               
                                   
            •
                              
                                   
                                        when a find request is searching an unstored calculation field whose calculation includes a global field.
                              
                                                                                                               
                                   
            •
                              
                                   
                                        during a find request on a table with access privileges that restrict access to certain records, and the calculation that determines record access includes a global field.
                              
                                                                                                               
                                   
            •
                              
                                   
                                        the evaluation of any other record access calculation that includes a global field in order to determine whether to display related data. For example, a record access calculation to determine the rows to display in a portal or the values to display in a related value list will occur on the host if the record access calculation includes a global field.
                              
               To accurately evaluate these calculations on the host, FileMaker Pro transfers all the global field values in the current table from the client to the host. If you know that certain global fields will never be used in unstored calculations or record access calculations, you can improve database performance by creating these global fields in a separate table. This will prevent unneeded global field data from being repeatedly transferred to the host.

                

          • 2. Re: Global Storage
            JimMac

                 Storing "globals" in a single record table is a good idea whether the DB is a HOST or not.  This way saves a lot of conversion time when finally deciding to HOST it.  That table is linked by relastionships to all other tables needing a "recorded" global.  I use it for saving Version number, fiscal year,last time DB was backed up, last user and time last used, etc.

                 That "global" table can be used as a Navigational layout to access all other features of  a complex DB.

                 Jim...

            • 3. Re: Global Storage
              philmodjunk

                   In most cases, I prefer to use a script to load global fields from a table via a script when the file opens. That makes for a much less cluttered relationship graph as I can continue to reference the globals and yet can edit the table of corresponding non global values to make a permanent change.

              • 4. Re: Global Storage
                JimMac

                     @ Phil.... That one went over my head.... How do you refrence the "global" table without  a relationship?  If you use a script, you must pass a value list as script parameter then.

                     Jim...

                • 5. Re: Global Storage
                  philmodjunk

                       You reference the global field, not the table. You load the global fields with values when the file opens. To make a permanent change to the value of the global field, you do not edit the global field, you edit the corresponding non global field used to load this field when the file opens.

                       Admittedly, this cannot be used in all situations.

                  • 6. Re: Global Storage
                    melshamamyan

                         Phil can you please expand on how this script may look to do what you are suggesting?

                    • 7. Re: Global Storage
                      melshamamyan

                           Seems like it was a simple fix to my question. Once you make the change on where the database is being hosted and restart the file then all the client machines seems to retain it also.

                           Now wether or not that global field disappears if the host computer or file is restarted is a different question.

                            

                           Thanks for the help guys!

                      • 8. Re: Global Storage
                        JimMac

                             Mel, I will take a shot at an explantion with an example of how I use GLOBALS.  I will just do a simple Number type Global.

                             FMP defines a global as a single storage area which are not associated with a Record.  That storage is not saved or initialized in its simpliest form.  With shared DB's, who has control of that simple global field, the client or the Host.?  Dave gave you the references to that rule.

                        Oooopps.... power failure on host crying

                             What happens to the values in the simple globals?.... gone to bit heaven.

                             Lets program a simple business check printing printing program.... and global use...

                        Constants... [or single values defined by the user that remain constant for most times]

                             Minimum Check amount to print I will name [gMinCheck]

                             Maximum Check amount [gMaxCheck]

                        Varing Globals...

                             Next Check Number to print [gNextCheckNumber]

                             EmployeID of Last Check Printing [gEmployeeID]

                        Refrence Globals...  This is my defintion of globals that are shared between tables.  They can be Constants or Varing also, but helps me decide when an relationship is needed.

                             Key values for relationships.  [gKey]

                             Questions?

                             1) How does the user "initialize" the starting value which is Empty.?

                             2) Since those disappears on power down, how do you recover thoses Constant Global values without "initializing" over and over again.

                             3) How can you Increment the varing gNextCheckNumber from the printing table?

                             4) If  you have a reference path, how do you assure your gKey  always find a record?

                             5) How do you get the gEmployeeID  from the Personnel table to the Check Printing table?

                             6) What is the difference between table defined globals like gMinCheck and FMP $$MinCheck.?  ANS: convienice and documentation.

                             What Phil was describing in part was the Reinitialing globals from a Stored power failure proof area.

                             What I was describing was the same plus making relastionships where needed for the Varing Globals.

                             So I like, just my experience, a single record table that gets stored by FMP and contains all the global types except $$Globals.

                             Jim...

                              

                              

                        • 9. Re: Global Storage
                          philmodjunk

                               Yes, but if the fields have global storage specified, you do not need to define a relationship to that table in order to access the field.

                               And what I am describing also allows you to make a permanent change to the value that users initially see in that field without having to pull a file down off the server, open it up in FileMaker Pro, edit the global and put it back up on the server. It's one of two ways you can make a lasting change to a value made accessible with global storage.

                               The other way is to create a script that modifies the global field and then you use a one time server schedule to perform that script. I often have a "clear globals" script for all global fields--such as search fields that should always be empty at start up. After I put up a new copy of the file on the server, I may have forgotten to clear all of tose fields. Running this script from a server schedule allows me to correct my omission without major hassels in doing so.

                          • 10. Re: Global Storage
                            JimMac

                                 An additional thought....

                                 The above works for the HOST or client computers....

                                 But many times we need what might be called client computer only globals... LOL   kinda of a Local Global.  A term might be called...

                            Scratch Pad Globals...

                                 Many times you might not want to save the value so you make a note on a Scratch Pad next to the client computer or no need to save or recover them.

                                 The HOST doesnt need them so, like a Scratch Pad, tear off the scribble and throw away.  $$Globals are great for this type.

                                 Jim...

                            • 11. Re: Global Storage
                              JimMac

                                   Great clarification , Phil...

                                   Any field in a single record table ACTS like a global, but is not Storage specified Global.

                                   Phil, notes the difference.  Thanks.

                                   Jim...

                              • 12. Re: Global Storage
                                philmodjunk
                                     

                                          Any field in a single record table ACTS like a global, but is not Storage specified Global.

                                     Unless the field in that 'single record' has global storage specified. wink

                                     It's often very useful to put all fields specified to have global storage in one single "globals" table for easier management of those fields. This is why I have been attempting to "clarify" what you mean by a 'globals' table.

                                     The exception to putting all global fields in the same table are global fields used as match fields in relationships. Obviously, they have to be defined in specific tables in order for them to be used in that way.