3 Replies Latest reply on Feb 28, 2014 2:20 PM by Stephen Huston

    FM 13 Global field delete


      I have a global table.

      By script I delete all records.

      Upon examination, there are no records, but the prior values still show.


      So, I add a new record. Still the prior valaues show.


      Beside replacing the field contents of each field with "", isn't there an easier way?





        • 1. Re: FM 13 Global field delete

          Why do you want to add or delete records from a global table. Globals field values are not part of a record. They are part of the file.

          • 2. Re: FM 13 Global field delete

            Global fields are NOT connected to any record. They are attached at the table level, not the record level. That is why, when there are no records, there is still data showing in the Global field.


            Maintaining Global fields is on a per client basis. That is what they are for and why they exist. You have to treat them differently than other fields. I suggest creating a startup script that sets the globals as required. When I create a DB and host it I usually make sure the global fields are all ‘EMPTY” before I put it up for hosting.


            Or I use Global Variables which are faster and that I find easier to use. YMMV


            Another solution is to use the auto-enter-data option and create a new record. To change what it will be you need to change the field definition. Then when you create a new record in that table the global is reset to its default value. Primary usage of this technique is in a one record preferences or globals only table.

            • 3. Re: FM 13 Global field delete
              Stephen Huston

              Global values can be changed only in an unhosted environment, and global fields retain the values they had when the file was last opened in an unhosted environment. Deleting the record(s) doesn't change the value last entered.


              If what you want to do is change the values, you either need to do it while they are unhosted, or you can the make the global field be a calculation which references a field which is not a global.


              For instance, you can have a non-global number field, which is even indexed, and define a calculation with a global result which is the value of the non-global number field.


              That global should update for each session, based on the value in the indexed number field in your one-record table when the session is started, allowing anyone with access to edit the non-global number to change the default global value for new sessions.