Jump to content

Global Field Not Working...


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

Recommended Posts

Hello FMP Wizards,

A few weeks ago, I had to switch to FMP 14 Server. Prior to that our little group was able to get by with hosting on one Mac but we had too many times when someone had to leave FMP so another person could get in. Anyway the transition was very smooth for all but one of my databases. I have one task that only I do. It's accounting related and I use three external files to do it. One is a deposit ticket, one is a table of the ticket lines and one I call "Incrimentor" which simply counts up the lines of the ticket and increments a global field when one of the tickets is full. It all works great BUT when it starts up, the global field I use to keep track of what ticket we are on ALWAYS resets to the number it was when I first moved to server. I have to manually kick it up to the last ticket. It's not the end of the world but in the past it just worked. Seems Global fields and server don't work like they used to...anyone have any suggestions or advice?

 

Thank you,

Link to comment
Share on other sites

The behaviour you are seeing is how global fields actually work: they are not meant for persistent data storage.  They are session specific: each user can have their own value in it and the initial value will always be what it was before being hosted.

If you close the value, the global field is reset to its default.

You'll need to store the data in a real field on a record.

Link to comment
Share on other sites

Thank you for your reply. 

I honestly don't recall why I made it a global all those years ago when I made the database. Is there a way to make a standard field behave like a global?

So what happens in the Incriminator database table is it basically counts up 18 records (lines on the deposit ticket), then it ads one to my global field. That's all it does. However if the ticket number were not a global, I don't know how to keep it consistent among the 18 records. 

Again, thank you (and anyone who cares to offer advice) for your time.

Link to comment
Share on other sites

I don't think I follow what you use the field for.  But you should not have to keep one piece of data duplicated x number of times and keep it in sync.  Keep a one-record table and create the field there then set that field as needed.

You can actually keep the global field as long as you store the value in it into a non-global field when you exit the solution, and read it and set it into the global at startup.

Link to comment
Share on other sites

9 hours ago, David Maffucci said:

it basically counts up 18 records (lines on the deposit ticket), then it ads one to my global field. That's all it does. However if the ticket number were not a global, I don't know how to keep it consistent among the 18 records. 

Couldn't you simply number the lines sequentially (using an auto-entered serial number), then calculate the ticket number as = Div ( n - 1 ; 18 ) + 1 ?

Edited by comment
Link to comment
Share on other sites

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