Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Populating foriegn key field using lookup table

Featured Replies

I have been out of FM development for a few years and now that I'm back, I seem to have forgotten some very basic things. (I guess that happens when you switch to MySQL and PHP for awhile!)

Should I use a global text field to allow a user to select the row from the lookup table? I only want to store the foriegn key in the master table.

Global fields are temporary storage so if you want permanent storage, use a regular text, number, date or time field. This will allow you to store a different value on each record.

  • Author

I'm sorry I should have been more clear. I recognize the difference between field types. I guess what I am asking is why would I ever want to store the field that the person used to lookup?

For example, I want to associate a doctor with a study, so i am going to store the PersonID for the doctor as a foriegn key in the study table. Onviously, my user will need to look the doctor up by name, as they don't know the key value. But I don't want to hardcode the name in the study. I want it to change if the doc's name changes (i.e. they get married). So it seems to me in that situation I would want to have the lookup of the doctor's name be done through a global, yes?

Thanks in advance!

Courtney

Yes, you should use a global field if you don't want to store the data permanently.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.