Jump to content

This topic is 8046 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi there,

I've made a database template with some global fields in the header. My problem is that when the database is hosted, any data I enter into those fields is lost when the file is closed and then opened again. The simple solution (or so I thought), was to change the field from global to just a normal text field. The only thing is that now, the header will go blank whenever I select a different record (hence, I'm guessing the reason for global in the first place). Is there any way of having a global field and still be able to save the data after the database has been hosted?

Help!!!

Posted

Global fields will take on the last values that were entered into them when opened directly in FileMaker Client (not via the server)

So, you can either close the files down on the server, then open them in FileMaker Pro client and edit the values. Then they will remember those values each time the database is opened).

Or, you can script the globals to be set via a startup script.

HTH

Posted

You could create a "preferences" file that would contain the global data and just reference that file.

HTH, Mike

Posted

The preference file is just another database file with one record that has the fields that you originally had as globals plus a number field with a value of 1 (one). You will use this number field to establish a relationship to the main file, so you need to create a calculated field in your main file with a value of 1. Now you can create a relationship between the main file and the preference file based on those two fields.

For example in the preference file, you would have TextField1, TextField2, ... and the number field (you can call it Constant). Then populate the text fields with whatever data you wanted in the globals. You can then write a script that when the main file opens, to set the main global field to the value in the preference field. Your script would use the Set Field function to put the contents of the preference file fields into the main file globals.

Set Field["global1","Perferences::TextField1"]

Just make sure the global field type matches the field type in the preference file.

HTH, Mike

This topic is 8046 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.