Defining global fields (fields with global storage)
A field that uses global storage (a global field) contains one value that's used for all records in the file. Global fields are accessible from any context in the file, even if the field is defined in an unrelated table.
To define global storage options for a field:
- Choose File menu > Manage > Database.
- Click the Fields tab.
- If your database contains more than one table, select the appropriate table from the Table list.
- For Field Name, type a name for the field.
See About naming fields.
- Click Options (or double-click the field name).
- In the Options for Field dialog box, click the Storage tab, then select Use global storage (one value for all records).
- Click OK, then click Done.
Global fields in hosted databases
When a client connects to a hosted database, each client's global field values are maintained independently from one another. This makes global fields useful as temporary storage locations for information unique to each client's session, such as fields used for filtering portals or lists.
The client's initial global field values are those that were in use when the file was last closed by FileMaker Pro on a local computer (not via FileMaker Network sharing). Any change a client makes to these initial values persists only for the duration of the client's session. If a client closes and then reopens a file, all global fields are reset to their initial values. To change these initial values without closing the file on the host and opening it locally with FileMaker Pro, set the initial values of global fields in a startup script.
- You can use a global field:
- for a value that occasionally needs to be updated in many places, such as a company address that appears on several layouts.
- as a fixed value in calculation formulas across all records in a file, or in conditional script steps, such as If, Else If, and Exit Loop If.
- as a match field for a relationship (see Working with related tables).
- as a user preference for filtering portals or lists.
- Global fields can't be indexed, and therefore can't be used to find records.
- You can use variables instead of global fields for temporary data storage. See Using variables.
- For information about how calculations that include global fields are evaluated, search the Knowledge Base.