Jump to content

Lookup Problems


Simon UK
 Share

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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 4387 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.