Simon UK Posted January 25, 2011 Posted January 25, 2011 Hi, I have a table where I store some default values such as charge rates and want to 'LookUp' these values when creating new job records in a job table. I created them as global fields and intially these seemed OK but when I reoponed the database and created new jobs the 'default charge rate' was empty? Has anybody else had this issue? I'm obviously doing something wrong but can think what else to do. I have the same problem when wanting to store an image for an invoice header in the same table as a container? Any advice would be appreciated. Regards, Simon
bcooney Posted January 25, 2011 Posted January 25, 2011 It's best to think of global fields as session-specific storage. That is, they do not retain their values when you close the FM file.* So, they must be "set" using a twin field that is not global. Often, devs use a Pref table, and an script that runs on File Open (an Open Script) to set the globals. Open System Script Go to Layout Prefs Set field gLogo to Prefs:Logo etc. Go to Main Menu *Actually, global fields will default to the value that was in the global when the file was last closed as single-user. I never trust this and always use an Update Globals script or simply set them, as above, in an Open System script.
Simon UK Posted January 25, 2011 Author Posted January 25, 2011 Hi, Thank you so much for the advice. I'll put this to work very shortly. Looking forward to the day I can help others too. In the meantime thanks again, it's really solved a headache. Kind regards, Simon
Recommended Posts
This topic is 5111 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