MicheleC Posted September 1, 2011 Posted September 1, 2011 I have a script that works fine for me but is not working (or at least, part of it is not working) for someone else on a different workstation. Any thoughts on why this might be happening? The script creates a new record and sets a bunch of field values automatically. The part that appears to not be working involves: a.) incrementing a global variable b.) concatenating that new value with some other stuff c.) putting the result into a field in the new record Everything seems to work except the incrementing. I can't figure out why it works for me but not for someone else. The database doesn't have any security or login restrictions on it. Ideas?
comment Posted September 1, 2011 Posted September 1, 2011 What exactly do you mean by "incrementing a global variable"?
doughemi Posted September 1, 2011 Posted September 1, 2011 Globals are specific to each user. In order to have "global" values available to all users, I use a one-record Global table (but don't define the fields as global fields). Relate this Global table to all other tables with an X (cartesian) relationship.
comment Posted September 1, 2011 Posted September 1, 2011 I use a one-record Global table (but don't define the fields as global fields). That's not something I would recommend lightly. Especially if the values are meant to be frequently modified. I suspect this is one of those cases where an auto-entered serial number should be used instead of ... well, whatever it is.
MicheleC Posted September 1, 2011 Author Posted September 1, 2011 I see. I also just found this in the Help: "If your file is shared, only the host's changes to global field data are saved. Changes are saved only when the file is closed." So that explains that. It isn't quite how I would have expected a global variable to behave, but there is some logic to it. You're right that an auto-entered serial number would be more convenient, but the string we want to create actually depends on a different variable, which can have one of two values (i.e. string1_001 or string2_001). Hence my trying to calculate it myself. I may just drop the idea and go with the auto-enter anyway. It creates a different issue down the road, but I think I can come up with a workaround. Thanks for your feedback.
Vaughan Posted September 1, 2011 Posted September 1, 2011 Global field or global variable? You seem to be using the two terms interchangeably.
doughemi Posted September 2, 2011 Posted September 2, 2011 That's not something I would recommend lightly. I remember reading somewhere that that was the way to do it. Could you explain why you don't recommend it? --Doug
comment Posted September 2, 2011 Posted September 2, 2011 I didn't say I don't recommend it. I said I wouldn't recommend it lightly - not without knowing what it's being used for. The reason is record locking.
Recommended Posts
This topic is 4832 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