Creating a custom app > Setting options for fields > Defining global fields (fields with global storage)
 

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:

1. Choose File menu > Manage > Database.

2. Click the Fields tab.

3. If your database contains more than one table, select the appropriate table from the Table list.

4. For Field Name, type a name for the field.

See About naming fields.

5. Click Options (or double-click the field name).

6. In the Options for Field dialog box, click the Storage tab, then select Use global storage (one value for all records).

7. 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 Advanced 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 Advanced, set the initial values of global fields in a startup script.

Notes 

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 FileMaker Knowledge Base.