Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hello,

 

I have a strange issue.

 

We have created a small db that has a global table. We can do everything we need when the db is on a pc such as change global field data etc.

 

Then when we move the db over to the server and then access the layout containing all the global fields, the fields will revert back to their original data.

 

So we have 1234 in a global field on our layout that is from our global table, we then typ 567 in that field and close the db. When we open the db again, 1234 is back in the global.

 

We do not have any type of relationship to this table.

 

Any suggestions?

 

Thanks,

 

Michelle

Posted

Global fields have to be set when the database is local (single user) 

 

I would recommend have NORMAL fields and ONE record in that database. And then relate that table to your other table occurrences with a Cartesian join.

 

Optionally put all your DEFAULTS in to a script and on user startup set the default GLOBAL fields.

 

Or you can set a server side script that will set the defaults when NO other users are logged in and it will reset the default global content.

Posted

Regarding the server script. AFAIK it should not be necessary to control whether other users are logged in or not.

 

However, only users who connect after the server script runs will see the new values.

Posted

Edit: I think a lightbulb just went off. We need to enter our desired data in the One Record Table and then have that data set in the Globals for that users session.

 

Would that be the correct line of thought?

 

Well, that did not work. If I run the script to set the globals directly from our single record layout the fields get populated, but If I try to run a script as a starup or a server side, the globals remain empty.

 

I am lost on this one.

 

***************************************************************************************

 

 

We have created the Cartesian join with a single record in the table and added three fields for testing.

 

Field_1  / Field_2 / Field_3  we entered some data in each fileld then told the script to set the golbal fields with the data from 1, 2 & 3.

 

The data that was in the globals to start with is gone and the fields are blank as if the data from 1, 2 & 3 was not set in the globals.

 

Did we miss somethng or, does this not function in this manner.

 

If we go in the scrip and physically type data in the Set Field step of the script, the data will get set...just not if we attempt to Set Field via another field.

 

M.L.

Posted

Not enough information.

 

When did you run the script?

 

Since the content of globals is user specific you will have to run your set-globals-to-defaults script as part of the user's startup script for the file in question.

 

Or - as mentioned - you will have to run the script as a scheduled server script.

But perhaps you don't know how scheduled server scripts work, and how to set up server admin to run scheduled scripts?

Posted

Michelle here is a sample - 

 

Very basic - it shows a prefs table and a data table - Its a bit redundant but i always have a habit of having a "constant" field that = 1 and use that to make my join for Cartesian relatioships - although by nature a cartesian can use ANY fields. 

 

If you just need to VIEW the defaults you can simply place the related fields on the layout. if you need to capture the default data as it was when the record was created you will need to script record creation or have a button that sets the defaults to the local fields.

 

sample.fp7.zip

 

hope this helps.

 

 

Posted

Sorry for the delay...flu!

 

The example was a great help, thanks for taking the time to put it together.

 

M.L.

  • 4 weeks later...
Posted

Similar Issue: 

FM12 Server installation

We have text fields with global storage which happen to be Delegate Type Names, which tend to get changed based on our client

So in this case the global fields affected are "Delegate Type 9 Text" and "Delegate Type 10 Text"

I just double-checked and they are configured as Text Fields with Global Storage

So with a Full Privilege Set from my workstation I'm going into "Open Remote....", selecting the FM12 hosted file, changing the field contents....but when I close, the field reverts.

 

I've done other programming changes to scripts, layouts, etc....I do not understand why this is an issue.  Nor how to fix.

 

Can anyone help?

 

 

Thanks so much, CB.

Posted

Please read Ocean West's (Stephen's) post above.

 

Each logged in account receives their own values for globals. You cannot reset them by updating global fields when the file is hosted.

 

The most often used technique is to have a one record table of preferences and a script that is set to run on File Open that sets the values in the preferences to their corresponding global field.

Posted

Please read Ocean West's (Stephen's) post above.

 

Each logged in account receives their own values for globals. You cannot reset them by updating global fields when the file is hosted.

 

The most often used technique is to have a one record table of preferences and a script that is set to run on File Open that sets the values in the preferences to their corresponding global field.

 

My problem is that instruction set is over my head. 

 

I've been programming standalone FM files for corporate event management for going on 12 years, but I have no background in FM Server (or Server Administration) and as such the above description from Stephen is way over my head.

 

If there's a "How to fix this for dummies?" explanation, I'd be incredibly appreciative.

 

The one thing I read from Stephen's reply that I think I understand is that he seems to indicate that you can modify a global field and have it stick if you open it you open the file as a local user.

 

If the file is currently hosted on FM12 server, do I have to close it through administrator console before opening it in local mode with FM Pro Advanced...then I can change globals before re-opening in FM Server?

 

Thanks again....and my apologies that I don't have the knowledge you guys take for granted....I truly wish I did, but I don't. 

 

 

Cheers, CB. 

Posted

Yes, you are correct. If you want to change the default value in a global field there are three methods:

 

1. Unhost, change, rehost. (very disruptive).

*2. Set the global values in an open script (tell me if you're not sure what I mean by that).

3. Run a server script that sets the globals (as Bruce mentioned).

 

*my favorite method.

Posted

Yes, you are correct. If you want to change the default value in a global field there are three methods:

 

1. Unhost, change, rehost. (very disruptive).

*2. Set the global values in an open script (tell me if you're not sure what I mean by that).

3. Run a server script that sets the globals (as Bruce mentioned).

 

*my favorite method.

 

You probably predicted this, but I don't know what an 'Open Script' is....

 

I've written hundreds of scripts over the years....99% of which were related to button launches and report generation.... but as I'm sure this is going to be something I'm going to have to do a lot, I would really appreciate your help.

 

Our office just changed from local use to FM server this month and the learning curve has been steep....

 

 

Thanks so much, CB.

Posted

Open Script = the script that is selected in File>File Options>Perform Script

 

This script often contains the setting of global fields.

 

In pseudo code a section of the script would be:

 

go to layout "Prefs"

set field Globals::gLogo, Prefs::logo

set field Globals::gAddress, Prefs::address

set field Globals::gtaxrate, Prefs::tax rate 

Posted

Actually that is not where this option is set now.

 

The new routine in FileMaker 12 is File>File Options>Script Triggers>OnFirstWindowOpen

Posted

Open Script = the script that is selected in File>File Options>Perform Script

 

This script often contains the setting of global fields.

 

In pseudo code a section of the script would be:

 

go to layout "Prefs"

set field Globals::gLogo, Prefs::logo

set field Globals::gAddress, Prefs::address

set field Globals::gtaxrate, Prefs::tax rate 

 

I think I get it....will test this evening and drop you a note.  Thanks so much.  Really appreciate the help.  :thumbsup:

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