Clearing Out Global Fields

May 20, 2017
William

Here is a great tip from FM Developer, Matthew Dahlquist about clearing out global fields from a server:

Typically, when a file is uploaded to FileMaker Server, any global fields which have data in them are retained in the server. If you need to change them, you can’t just delete them because they are frozen in their original value when uploaded. In order to change them, many developers have had to close the file, download it, and then alter the values, and then upload the file once again.

However, as Matthew has pointed out, when a field is changed from global to a standard local field, one receives a warning from FileMaker which says that the contents of this field will be lost if you change the field format. And that is exactly what you want! So if you want to get rid of the contents of a global field, then just change the field to a standard local field, and save it by entering browse mode once again. Then go back and change it once again to a global field. Now it will be empty of the original value.

Then of course, to set the value of global fields to that which you need, just do it during startup. I have a standard script which I use, called “Set Globals”. It runs during the startup script and just goes to each table needed and fills in the global fields from preset values or from local data fields, so that the globals are accessible from anywhere in the solution.

So there you have it; another quick productivity tip to power up your business.