Jump to content

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

Recommended Posts

Posted

I have a FM file shared with FM Server.

The file has a global field.

When the file is opened remotely, what is the initial content of the global field (or what the content depends on) ?

thank you

Posted

Your global field will retain the value it had when the file was last closed as hosted file, viz., before you put it on FMServer.

You can always initialise the field with an Open script.

Bear in mind that globals belong to the users (clients) - so each user could have a different value for the same field !

Posted

Your global field will retain the value it had when the file was last closed as hosted file, viz., before you put it on FMServer.

ok Mark, thank you.

In other words..

when you close the file as hosted the value of the global field becomes the DEFAULT VALUE for the file shared with fmserver.

But, is it possible that this deafult value gets changed ?

I've set the DEFAULT value of my text global field to "". Sometimes, in the morning, I open (remotely) the file and i found that the value has been changed.

I have scheduled a backup every evening. This makes me thinking that something happens when the file is backed up...

Or maybe opening the file (remotely) with full access privileges let me change the default value for globals ?

The only thing I'm sure about is that

1) the file have been accessed only remotely

2) the default value for the global has changed.

What do you think ?

Again, thank you.

Posted

Try this.

Take the file down from being served.

Open the file locally in either FileMaker Pro, Developer or Unlimited.

Change the value of the global field to what you want it to be.

Have FileMaker Server beging serving the file again.

Here's how it works. When you change the value of a global field for a file you are opening locally (i.e., not with server but from a mounted local or network volume), the value persists, regardless of whether the next time you open the file you do so locally or from a server. When you change the value of a global field from a served file, the value does not persist, but reverts to the stored value the next time the file is opened.

Because of this, I usually follow Mark's advice and set the value of global fields in served files inside of the script that is set to run when the file is opened. This way I don't have to worry about what value is stored. This works because of Mark's other comment about served files having global field values that are unique to each user. My script can set the value for each user as they open the file and each user can then edit it without altering the value that any other user has.

Let me know if the above technique doesn't work for you or if there's anything I've not made clear.

Chuck

Posted

Take the file down from being served.

Open the file locally in either FileMaker Pro, Developer or Unlimited.

Change the value of the global field to what you want it to be.

Have FileMaker Server beging serving the file again.

yes, I did this, and I've set the stored value of the global text field to "" (empty). But sometimes the default value of the global field (the initial value of the field when the file is opened remotely) changes and is no more empty. frown.gif

If this happens just to me, then I must have done something wrong somewhere. crazy.gif

I was just wondering if, under some circumstances, it is possible to change the stored value of the global opening the file remotely.

I usually follow Mark's advice and set the value of global fields in served files inside of the script that is set to run when the file is opened. This way I don't have to worry about what value is stored.

Well, I want to worry about the value stored.

Every open script in my files check the value of that global field and perform depending on the value (empty or not) of the field.

Thank you.

Paolo

Posted

I was just wondering if, under some circumstances, it is possible to change the stored value of the global opening the file remotely.

How are you opening the file remotely? If you're using FileMaker "Hosts", there should be no way to change the default value. Sounds like you are opening it from a shared volume.

Every open script in my files check the value of that global field and perform depending on the value (empty or not) of the field.

But didn't you just say that you always want it to be empty??

If each global field has it's own default value, simply it to that value every time the database is opened.

A hosted database's globals should never change as a result of the action of any client, so I can't see how you are checking the values of these fields to accomplish anything...

Posted

I guarantee, "something you know, ain't so". Go back and check that the field is REALLY, REALLY a global field. Naming a field as a global, but accidentally making it a normal text or number field can cause all of these sorts of symptoms.

-bd

Posted

when you close the file as hosted the value of the global field becomes the DEFAULT VALUE for the file shared with fmserver.

But, is it possible that this deafult value gets changed ?

I've set the DEFAULT value of my text global field to "". Sometimes, in the morning, I open (remotely) the file and i found that the value has been changed.

First check if the field is really a global field ... it happens frequently to name a field gSomething and later discover to have forgot to set it as a global field

If you want to have an empty global when opening the file just add a Set field (global;"") to an opening script

For the sake of the discussion it migt be possible to change the value of a global in served file by a sort of vodoo procedure:

Open the file as the only guest of the file

Change the value in the global

Enter field definitions (you must have the server admin plugin of course)

Exit Define fields, even doing nothing

The global will retain the just entered value

Posted

Open the file as the only guest of the file

Change the value in the global

Enter field definitions (you must have the server admin plugin of course)

Exit Define fields, even doing nothing

The global will retain the just entered value

BINGO!!! laugh.gif

This procedure let you change the "stored/default" value of global fields in served files (with remote access).

Thank you very much! For a sort of coincidence, sometimes, I was applying this procedure and the global value was changing... you helped me a lot! grin.gif

by the way: where did you find that information? Is it an undocumented feature?

ps. you wrote:

(you must have the server admin plugin of course)

no, you just need privileges to enter "Edit Fields"

Posted

But didn't you just say that you always want it to be empty??

If each global field has it's own default value, simply it to that value every time the database is opened.

A hosted database's globals should never change as a result of the action of any client, so I can't see how you are checking the values of these fields to accomplish anything...

I'll explain better my situation:

I've implemented a custom "password protection system".

One file is called "login" and has the global field "theUser", whose default value is empty "".

Every other file have an open script that checks the value of "theUser". There are two possibilities:

1)If the field is empty then the user have not been authenticated yet: a script (in the file "login") is performed asking the user his name and pass. If they match then the username is stored inside "theUser" and control goes back to the original file.

2)If the field is not empty then the user have already authenticated, his name is stored in "theUser", no further authentication is required, access to the original file is granted (according to users's privileges).

Users authenticate themselves only one time, when they open the first file (any file)

Authentication lasts as long as they keep FM open; users can close files (except the file "login") or open new ones without authenticate again.

When they quit or shut-down the computer the value of "theUser" is lost and they'll have to authenticate again at the next connection.

(Off course it is vital, for me, that the default value of "theUser" is ALWAYS empty. That's why I asked if it is possible to change it remotely)

---

I implemented this because:

1. I keep usernames, passwords and privileges in a single (filemaker) file; every user is a record in a database file.

2. User authenticates with name and pass (not just pass)

3. The current user's name is stored in "theUser". When important actions take place, I store a copy of "theUser" in appropriate fields, so I can keep track of who did what.

Posted

BINGO!!! laugh.gif

This procedure let you change the "stored/default" value of global fields in served files (with remote access).

Thank you very much! For a sort of coincidence, sometimes, I was applying this procedure and the global value was changing... you helped me a lot! grin.gif

by the way: where did you find that information? Is it an undocumented feature?

Can't remember where I read it ...

I don't recall being mentioned any documentation of it

Posted

Are you really sure "theUser" is a global field?

Sorry if i didn't replied..

Yes, I'm sure. It was the first thing I checked.

The value was changed remotely with the procedure decribed in Pupiweb's post.

Posted

Let's just step back and look at the whole configuration.

1) What platform is FM Server on?

2) What platforms are the clients?

3) What version of FM Server?

4) What version of FM Client?

5) Is the FM Server machine running anything besides FM Server? A client copy of FM? File sharing?

Is it possible that the actual file being opened resides somewhere besides on the FM Server machine/FM Server program?

-bd

Posted

Let's just step back and look at the whole configuration.

1) What platform is FM Server on?

2) What platforms are the clients?

3) What version of FM Server?

4) What version of FM Client?

5) Is the FM Server machine running anything besides FM Server? A client copy of FM? File sharing?

Is it possible that the actual file being opened resides somewhere besides on the FM Server machine/FM Server program?

Brent, why do you ask this? The quest was solved!!!

For the sake of the discussion it migt be possible to change the value of a global in served file by a sort of vodoo procedure:

Open the file as the only guest of the file

Change the value in the global

Enter field definitions (you must have the server admin plugin of course)

Exit Define fields, even doing nothing

The global will retain the just entered value

This is EXACTLY what I did, and that's why the global changed!

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