2 Replies Latest reply on Apr 15, 2015 7:42 AM by AnupSatyal

    Repeating Serial Numbers



      Repeating Serial Numbers



      I have been trying to figure out a way to relate contacts to company in a many to many relationship and have created the join tables. However, I have the following problem:

      I have 3 contacts for each company. The table "Contacts" has their contact info. I have a "Company" table which already has a portal to the Contacts table. The problem is that for every new record I create in the Contacts table, the serial number is auto-entered so it increases and the company changes when I need 3 records on the Contacts table for each record on the Company table.

      Is there a way to auto enter 3 repeating serial numbers and increase them. For example, in the Contacts table, this would be 1- 1- 1 (3 records in the database) then 2- 2- 2 ( 6 records in the database) and then increases upto 600-600-600 ( for example)?


        • 1. Re: Repeating Serial Numbers

          It appears that you have some confusion in setting up an auto-entered serial number as a match field between your tables. It sounds like you have a company ID field defined in your contacts table as an auto-entered serial number. This should not be the case.

          A many to many relationship between contacts and companies means that a given contact can be associated with any number of companies and a company can be linked to any number of contacts. Is this what you actually need?

          if so:

          Start with these relationships:


          companies::__pkcompanyID = company_contact::_fkcompanyID
          contacts::__pkcontactID = company_contact::_fkcontactID

          You can place a portal to company_contact on the companies layout to list and select  contacts records for each given companies record. Fields from contacts can be included in the Portal to show additional info about each selected contacts record and the _fkcontactID field can be set up with a value list for selecting contacts records by their ID field.

          But if a contact can only be linked to a single company a simpler set of tables and relationships may be set up as you now have a one to many relationship from companies to contacts.

          • 2. Re: Repeating Serial Numbers

            This solution works perfectly!! I realized that instead of creating records in the Contacts, the best way was to create records for in the Portal in the Companies. Then all I needed to to was to go back to the Contacts and edit the rest of the info. Thank you!