Jump to content

Noob: relationship confusion


Charlie Kilo

This topic is 6458 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

This topic is 6458 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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