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.

Noob: relationship confusion

Featured Replies

So I have two tables:

--

CONTACTS

contact_id

contact_name

job_title

COMPANIES

company_id

company_name

website

contact_id

--

Here's what I'd like to do. I'd like to create a COMPANY record. Then, when I'm creating a new CONTACT record, I'd like to select from the list of available companies via a drop-down list. Once a company is selected, the field companies_website will display on my contact layout.

I'm sure this is really simple – I can do it in HTML & MySQL pretty easily - but I'm not sure how to go about this in FM. Can somebody please help me?

Well it seems like you would want the CompanyID in Contacts, not the ContactID in Company? Wouldn't you have many Contacts for one Company? Well, the idea is that you can cross-place any related field directly onto your layout and it will display the related information (in this case, Company website).

If you truly have many Companies for one Contact, then you may need to sort that relationship (in your graph) so that the first related Company record is the one which contains the website. But it sure feels backwards to me, ie, you probably want to relate CompanyID = CompanyID here, with the CompanyID in the Contact table. Then when you select a Company from drop-down (inserting the CompanyID), it will fill in the website on the Contact layout because the website FIELD is from Companies. :wink2:

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.