3 Replies Latest reply on Nov 24, 2012 11:02 PM by philmodjunk

    Beginner's Problem



      Beginner's Problem



           I am facing what seems to be a simple issue.  I have two tables: Contacts and Company, I would like to be able to enter a value for 'Company' into 'table:Contacts' and have a coorelating, blank field in 'table:Company::CompanyName' appear in the records.  Currently, nothing happens even though I have the 'table:Company::CompanyName' relationship set to 'Allow Creation of Records'.

           What am I doing wrong? Thank you.



        • 1. Re: Beginner's Problem

               Generally speaking, Using a name field such as companyName to link tables in a relationship is not a good idea. Company names are not unique and are subject to change. If you change a company name with the above relationship, you disconnect all contacts with that company name.

               Defining an auto-entered serial number, __pkCompanyID in the Company field and linking companies to contacts by matching it to a number field in contacts avoids these issues.

               With either approach, "allow creation..." is a setting that does not automatically create a matching record in the related table. Most of the time, it is used so that you can create new records in a portal by entering data into a blank row in the portal without needing to enter data into the match field in the portal table.

               I'm not fully sure what exactly you want to do here. Do you want to create a new Company record from a layout based on contacts? Or just display data from an existing record in Company on the Contacts layout?

          • 2. Re: Beginner's Problem

                 Dear Phil,

                 Thank you for the advice on best practice. What I would like to be able to do is enter a new company name through the Contacts layout (to be completed later) or restrict the choice of companies to only existing ones. 

                 Thanks again.  


            • 3. Re: Beginner's Problem

                   The company name field should only exist in the companies field.

                   You can use a value list of ID numbers and names to restrict the choice of companies to existing ones.

                   I recommend a "new company" button on your contacts layout. A script performed by it can create a new record in the company table and link it to the current contact record.