January 25, 201114 yr 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
January 25, 201114 yr 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.
January 25, 201114 yr Author 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
Create an account or sign in to comment