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.

are these primary keys okay?

Featured Replies

Hello

I'm new and I'm struggling with the concept of primary keys.

I've got four files for a farm.

Planting details which times the planting of crops, and works out how many seeds are needed to be planted based on a grower's order. (Has variety, grower's name, planting date, picking date)

Plant growth which just has the different growth rates of a variety given the time of year planted. (Has variety, january, february...december)

Seed bank which maintains a running balance of different varietal seeds in stock. (has variety, date in, date out, then calculation fields)

Growers which is a contact database of clients. (growers name, address, telephone)

The first three files all have defined relationships based on variety. The contact database I'll link to Planting details with Grower name so I can work out who the seeds are getting grown for.

I haven't set up any specific auto-entry fields as primary keys but notice that filemaker has indexed the variety field automatically in the first three files (I suppose based on the relationship). Is this fine?

Is there a specific reason for setting up an automatic numbering system for each record in a file?

I'm wanting to work this out now so that I have no nasty surprises later on when the fields are populated with data.

Thanks everyone

Drew

PS. I suppose indexing the contact file with an automatic number would help with that file in case two grower's had the same name. Is this correct?

It's generally considered asking for trouble to use names of any kind as primary keys. Like you said, "...in case two growers had the same name." shocked.gif Yikes! Also, what if a person or plant's name needs to change? A big mess if you're relying on that as a key field. Much safer to go with some sort of number or alphanumeric code that is used ONLY for database housekeeping.

  • Author

Thanks to both of you for your help.....much appreciated....drew

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.