Jump to content

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

Recommended Posts

Posted

Are these files being served by chance?

Where abouts are you making the changes (Define Fields, layout mode, or Browse mode).

What change are trying to make?

Posted

They are being served. I'm making the changes in browse mode. I trying to change the image in a container field. I want this change to be reflected for ALL users.

Posted

Globals become local when the files are being served.

I'm not an expert when it comes to a served environment, but I believe you will need to take them off of the server in order to do this.

HTH

Lee

Posted

A common way to do this is to create one file with a single record. You put all your "global" fields in this file and access them using a constant relationship from the other files. The trick is that the fields you create in this file are actually non-global fields. That way all users will be working with the same set of data.

  • Newbies
Posted

BobWeaver said:

A common way to do this is to create one file with a single record. You put all your "global" fields in this file and access them using a constant relationship from the other files. The trick is that the fields you create in this file are actually non-global fields. That way all users will be working with the same set of data.

I kind of know what you mean by this... but are there any sample files or tutorials or something that could help me along? As you can see I'm a newbie.

Posted

I don't have a sample handy, and I'm just packing up to go on holidays for a while, so maybe someone else here can post something.

But, to give a bit more detail:

The constant relationship is based on a field in the global file that contains the value 1, and global or calculated fields in the other files that contain the value 1. So, no matter which record you are on in the other files, you can always access the fields in record 1 of the global file. So, just create whatever container, text, or number fields in the global file that you want to use as globals (but define them as regular fields), and store the data there. Then if you want to include them on layouts in your other files, just reference them by the relationship.

Hope this helps.

Posted

Let's see if I can provide a simple explanation about Globals...

Global values are persistent throughout all records in a file - in other words, the value is the same for ALL records. Even if the found count is 0 you can still access and manipulate the Global data - however, there must be at least 1 record in the file to store the global values when the file is closed.

Global values are also unique for every user - every user of that file can have his/her own unique values, or they can be the same for everyone. This is true whether the file is a single user file, a shared file, or a served file - unique values for every user.

Now, here's where people get a little murky in understanding Globals - the persistent values in the Global fields - or - when does a Global field keep it's current value and when does it revert to another value and when does it revert to a previous value?

On a single user file, the Globals will retain the last values held when the file was last closed. So, if you have a file that only you use, when you close the file and are not changing Global values with an open or close script, those same values will still be there when you open the file again.

On a shared file, the Globals will retain the values of the last user, or the Host. Here's where some differences occur. If you are a Guest of a shared file and even if you have a close script that changes the Global values, when you open the file again, the values will be the last values of the Host of the file.

On a server-hosted file, the behavior of Global values are the same for a shared file, with a few twists that can be overlooked. In this case, the server is the host, so whatever values the Global fields had when the file was placed on the server and opened will persist and remain the initial, or default values whenever any Guest accesses the file on the server. They will initially be the same for all Guests.

The trick here is to enter the initial or default values you want the Global fields to have when your users open the server files - even if you want them to be blank (which is what I almost always use). If you have server-hosted files that do have the correct initial values you have to close the file on the server, open the file on another machine, set the default values, close the file, then reopen the file on the server.

I almost always set server file Global field values to be empty, except in the case of Global container fields that I use to store predefined images, conditional buttons, etc.)

I include a sub-script in my open script to set the initial values for the user. I also include a sub-script in my close script to clear all of the Global values - just in case.

Now here's another gotcha with Globals and server-hosted files: If you define a new Global field while being hosted by the server, the value of that new field when you close the file will now become the default value - make sure that you clear that field or set to what you want the default to be before closing.

Whew... a bit long winded, but I hope it might de-mystify globals for some folks out there.

This topic is 7856 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.