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.

3 questions on relationships

Featured Replies

  • Newbies

Hello all. i've got 3 questions for all you out there. I'm somewhat new to FM so these might be easily answered questions. And sorry, wishes/magic genie not offered for answers. Anway:

1) I read several FM books. But none explicitly mention the fact that relationships seem to be made in the children files. Why is this done instead of making the relationships in the Parent file? E.G. the relationship btw. customer (one) to invoices (many) is created in the invoices file. This seems odd to me. Anyone know why its done like this- to confuse beginners? Odd. Seems it would be more logical to define it in the parent file....

2)I thought one of the rules for a db to be relational is that every record MUST have a primary key. Seems FM will let you create a record w/o one. Does it use a default pk as the first record or does FM just wink at this rule?

3)I've been experimenting and found that I was able to creat a child file (invoice) w/o necessarily defining a specific parent (customer) to which it belongs. What happens to this file- is it just an orphan? How can it exist if there is no customer tied to it?

Any help FM masters would be most appreciated. Cheers.

Hello, gogolo.

1. Perhaps I don't quite understand what you mean, but it seems to me it depends on what you consider your parent file. Consider the "Many to 1" relationship, where many items can be related to one item, you can certainly create your relationship in the "many" file. I did it, because the "many" file I considered to be my "parent file." I think the "customer to invoice" analogy is good, but may be too limiting when considering the different types of relationships.

2. You're right. Every relational database must have a primary and foreign key. And yes, FM allows you to create records without them. I think there might be two reasons for this: 1. flat files don't need them (unless youre doing a self-join) 2. The DEVELOPER should be the one to determine what the p/f. keys are, not the application. You are the one that knows what data you want to extrapolate (did I spell that right???)

3. Again, the customer/invioce analogy may be a little limiting to understand this. If you do not desire creation of related records, then uncheck "Allow creation of related records" when defining relationships. For a great explanation of relationships, check out this string:

http://www.fmforums.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=8;t=000018;p=

I hope I could be of some help. There are a great number of experienced FM users here that will be able to help you more.

Ken

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.