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.

How to generate multiple keys?

Featured Replies

Hi,

I am desiging a relational data modell in FM. Most of my objects need two attributes as a sufficient key, e.g.:) I cannot only use the name but have additionally to use the age of a person. so those two attributes should serve as one key.

My question is, how I can do that in FileMaker. Does FM offer Multiple Keys (and a Multiple Key has not to be mistaken for a multi-key field, which is something different).

Thank You

Ralf from Kampala / Uganda

cannot only use the name but have additionally to use the age of a person

... um isn't that potentially a bad idea? What if the persons name changes, and why would you use an age (an abitrary value) which is guarranteed to change as a primary key... unless you wanted to store seperate records for each person depending on their age, but at the same time, why would you use a name?

For Example

You enter a name: Jhon

You create 3 related records based on the name

Jhon, Jhon, Jhon

Then you realize you mispelt the jame Jhon and it should've been spelt John, what do you do? If you change it to John, your other 3 records cease to relate to your record.

In the same sense, a user's age would normally change each and every year.

Now, to actually answer your question...

You CAN relate any Table Occurance to any other Table Occurance by any number of Fields thereby creating a Multiple Key relationship, as opposed to combining values of one or more fields in one field and then relating to another single field which would be a multi-key field relationship.

In either case, despite being possible iit's highlghy unrecommended, you should be using a serial generated value for your primary key, not something the user can change.

  • Author

Thanks a lot again and many greetings from Uganda and Germany to Australia

Ralf

In FM6 and below, you would need to use a calc to build a concatenated key, like this:

Name_Age (calculation, text result) = Name & " " & Age

While I'd agree with Genx about the problems with relationships built on user data, there are often times when such relationships are needed. Not for the primary relationships, but for interface relationships and filtering.

*******, i missed the FM 6 bit... i always forget to check version.

Often times when such relationships are needed. Not for the primary relationships, but for interface relationships and filtering.

Naturally :)

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.