mikemccloskey Posted May 13, 2002 Posted May 13, 2002 After entering information in an editable global field in a file being served by FM Server, when some other user opens the file, the data is different or missing. It doesn't seem to stick. Any ideas why?
andygaunt Posted May 13, 2002 Posted May 13, 2002 Hi, A global field is not a constant value. Firstly it is different for every user. Also, it retains the last values of the last person logged into the server. The best way to have globals keep their information is to write a script that runs on startup of the database to set the global values. HTH
mikemccloskey Posted May 13, 2002 Author Posted May 13, 2002 thanks andy. Could you tell me how to write a script that will set global values?
andygaunt Posted May 13, 2002 Posted May 13, 2002 Mike, If you want your values to be the same for each user when they login, and also constantly the same time after time. Set field [ global field1, "your value here"] Set field [ global field 2,"your value here"] repeat for all globals. Now, assign this script as a startup script from preferences > document.
mikemccloskey Posted May 14, 2002 Author Posted May 14, 2002 Thanks. I was hoping that I could enter information in the particular field and it stay there no matter what. Evidently that can't be done. Thanks for your help.
LiveOak Posted May 14, 2002 Posted May 14, 2002 Not exactly correct. FM Server retains the global data from the last time the files were opened using FileMaker (client) as the first or only user. All users of FM Server (first or otherwise) lose their global data upon quit. To save a value as a constant which can be modified in multi-user mode, create a "Perferences" file with a single record. Password protect it so that no users can create or delete records and use the fields in this single record to store data for all users. Globals would more properly be called "Locals" as each user has a unique set of globals. Their initial value is the value from the last value from client FM/single user opening of the files. You must take care that the order of update of these values does not cause a problem. e.g. User 1 gets the last check number and adds one, User 2 gets the last check number and adds one, User 1 writes the value back, User 2 writes the value back. As you can see in this example, the last check number in our hypothetical accounting package should be incremented by 2, but is only incremented by one and two checks with the same number are printed. It is up to the programmer to use semaphores (flags) and scripting to prevent this from happening. -bd
Recommended Posts
This topic is 8300 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 accountSign in
Already have an account? Sign in here.
Sign In Now