3 Replies Latest reply on Jan 23, 2014 6:33 AM by erolst

    set a contact as main default contact

    m.mcdonell

      I have a relationship database with customers and contacts. Since often the case, we have more than one contact for a customer. At the moment, they enter a contact portal and are able to select a contact to become the 'default'. This triggers a script that sends the appropriate fields to a series of default contact, default mobile, etc located on the customer table.

      Is there a smoother way? I want to be able to edit the default contact info directly with it making changes to the appropriate contact.

      Thanks for the help in advance

      (using FP13 Pro)

        • 1. Re: set a contact as main default contact
          beverly

          Well, there's:

           

               1. setting in the "child" file, but then you need to "unset" all others for the same parent when you make a change.

           

               2. setting a new field in the parent with the primary ID of the child record which is the main contact. Thru conditional formatting you can highlight this in the List from children or in a portal. And you can always use the field (call it Primary_Contact, perhaps?) for finds, scripts, other relationships, eSQL queries, etc. You can "set" this field in the parent (customers) by clicking a child record (contacts) in a list or portal. It would effectively replace another if there was a previous contact.

           

          HTH,

          Beverly

          • 2. Re: set a contact as main default contact
            m.mcdonell

            Thank you, I am using a similar variation to your second recommendation at the moment. My difficulty is, for user simplicity, I am wanting them to be able to edit the Primary_contact and have it change the correct child record. I am thinking a case calculation script trigger on entry to the field to confirm a match with the child and then an exit script that rewrites the data but can't quite get it.

             

             

            --

            Michael McDonell

            ECS Cares Incorporated

            T: 705.725.0940 M: 705.828.1208

            www.ecs-cares.com

            Environmental Solutions since 1969

            • 3. Re: set a contact as main default contact
              erolst


              m.mcdonell wrote:

              I am thinking a case calculation script trigger on entry to the field to confirm a match with the child and then an exit script that rewrites the data but can't quite get it.

               

              You don't need anything so convoluted; create a relationship via Company::primaryContactID = Contact_byPrimary::_pk_contactID), so the primaryContactID gives you an unambiguous pointer from a company to its primary contact record.

               

              Then display the related contact's fields on a Company layout in a one-row portal, where their contents can be edited.

               

              Strictly speaking, a portal isn't necessary to see the first (or only) related record, but using a portal makes the related fields disappear if no ID is set (and thus avoids the confusion from people trying to write into visible, but non-valid fields).