6 Replies Latest reply on Jul 21, 2011 9:06 AM by brianquillin

    Trying to add more than one contact to a company...

    Sam3

      Title

      Trying to add more than one contact to a company...

      Post

      This is probably a really simple solution, we're trying to add more than one contact to a company via file maker.

      And every time we want to we have to start from scratch by adding all the details. I was thinking there must be a simpler way to go around this, hopefully by just keeping the page as it was and continually adding contacts... Any ideas??? 

        • 1. Re: Trying to add more than one contact to a company...
          davidhead
            

          Sam, this is a standard relational structure where you have two tables - one for companies and one for contacts. The contacts may be linked to company records via a company identifier (usually a serial number from the company record).

           

          The question is, now you know that, do you need help setting this up? 

          • 2. Re: Trying to add more than one contact to a company...
            Sam3
               Yes that would be fantastic, thanks very much.
            • 3. Re: Trying to add more than one contact to a company...
              davidhead
                

              OK, so you need two tables - Company and Contact. I will detail minimal fields for each table. You will need others for your purposes.

               

              Fields for the Company table are:

               

              ID : number, auto-enter serial, do not allow modification

              company name : text

               

              Fields for the Contact table are:

               

               

              ID : number, auto-enter serial, do not allow modification

              ID company : number

              first name : text

              last name : text 

               

              In the relationship graph you have two table occurrences (TOs). Join these by dragging ID from the Company TO to ID company in the Contact TO. Open the relationship by double-clicking the "=" box on the link. On the Contact side down the bottom, turn on the option to allow creation of records in this table via this relationship. Close that dialog and the Manage Database dialog.

               

              On a company layout, create a portal. In the Portal Setup dialog, show related records from Contacts. Click OK and add fields from the Contact table - first name, last name. 

               

              Back in Browse mode, you will be able to add contacts to the portal by filling in fields in the next empty row. These contacts will automatically be linked to the current company record.

               

              See how that goes for you. Come back and ask questions if you get stuck. 

               

              • 4. Re: Trying to add more than one contact to a company...
                Sorbsbuster
                  

                Sorry if I'm stomping all over this thread, but would it be complete heresy to suggest that in the Company Table that the Contact field (I'm assuming it has one; the original Contact Name for the company) could be made a Repeating Field, with the likely max number of contacts?

                 

                I know that Repeating Fields got  a lot of bad press from the purists, but I find them dashed useful, for exactly this sort of thing, for example.

                 

                Alternatively, just define in the Company Table several fields; ContactName1, ContactName2, ContactName3...

                 

                I recognise that neither of these are practical if there are liable to be a large number of contacts for each company, for example.

                 

                Alan.

                • 5. Re: Trying to add more than one contact to a company...
                  davidhead
                    

                  Sorbsbuster wrote:

                  Sorry if I'm stomping all over this thread, but would it be complete heresy to suggest that in the Company Table that the Contact field (I'm assuming it has one; the original Contact Name for the company) could be made a Repeating Field, with the likely max number of contacts?

                   

                  I know that Repeating Fields got  a lot of bad press from the purists, but I find them dashed useful, for exactly this sort of thing, for example.

                   

                  Alternatively, just define in the Company Table several fields; ContactName1, ContactName2, ContactName3...

                   

                  I recognise that neither of these are practical if there are liable to be a large number of contacts for each company, for example.

                   

                  Alan.


                  Hi Alan
                  It is a reasonable question to ask but the answer is quite easy - no. 
                  Problems with repeating fields include questions like "what is the maximum number of contacts allowed?". Why would you want to place a maximum on that?
                  So you would put the full contact name into one repeating field? That is poor structure so we would use two repeating fields - first name and last name. Then where do you put the person's position in the company? Or their email? Or their direct phone? Or notes about them? All these become addition al repeating fields to store attributes of a person - which are simply fields in a separate table.
                  And then there are the problems of creating reports from repeating field data. Give me a list of contacts for each company sorted by last name. Not possible with repeating fields unless you are very careful with data entry. Simple with a related table.
                  I wouldn't say that I am a purist but repeating fields are just the wrong thing to use when you have access to a proper relational structure. 

                   


                  • 6. Re: Trying to add more than one contact to a company...
                    brianquillin

                    Related question back to the first post.

                    I want to assign multiple teachers (table) to a school (separate table).

                    What steps would I take to assign a new teacher record (on the enter new teacher form) to an existing school record?

                    All my attempts have resulted in "school_ID" requires a value (error) and I have to revert the record.  I'm sure my relational structure is to blame but some help would be great.  

                    Thanks...