Jump to content

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

Recommended Posts

Posted

I added a global date field to hold CurrentDate. I have FM 5.5 running on multi-user platform and there's a script that sets the Global CurrentDate field to today.

On one user platform where I run this script regularly, it works fine, but that script does not affect the CurrentDate field on other users with the same database open. To get the CurrentDate set, you have to run the script from the machine on which you are working every time.

Did I miss something about the global field set up? Why is this not updating the field on the server side for all users?

Posted

Hi Bob,

Global fields are global in the sense that they can be seen from all records in the file in which they reside - so they are 'global to the file'. However as you've discovered, global fields are not global in any more general sense.

In particular, each user in a multi-user solution sees his/her own separate set of global values and changes made on client machines are lost when the user exits (ie only changes made on the host machine are saved with the file).

This is an important piece of information to understand when designing files for multi-user environments, and can be advantageous, as it allows users to store temporary values which relate to their current use of the database, without risk of conflict with values simultaneously being stored and accessed by other users.

If you require a way to share 'global' values between users, it is normally done by creating a single record file to which each file in the solution has a relationship. Values stored in this file (in normal data fields rather than globals) can be accessed by and seen by all users (via the relationship) from anywhere in the solution - and changes made by one user will be immediately available to the other users. wink.gif

  • 2 weeks later...
Posted

Bob,

Is there a reason why your global CurrentDate would not always be today's date? If it is always going to be today's date (not Today), couldn't you use Status(CurrentDate)in the script?

Also, if you create the single record file like Ray mentioned, define CurrentDate to be a calculated field Status(CurrentDate).

Paul

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