3 Replies Latest reply on Sep 9, 2014 4:54 PM by john@outdoorflooring.ca

    contacts related to each other

    john@outdoorflooring.ca

      Title

      contacts related to each other

      Post

      Hi there. I am stumped. I would like to in my contacts database have a portal where I can selected a related contact from the same table and go to that "related" contact and see the other related contact with out having to specifically select him ex.

      John Wagner is a contact in my database. I select from a portal a related contact Doug N. I would now like to goto Doug N. contact and without any further selection see John Wagner as a related contact.I am using  a join table to relate Doug N to John Wagner but I cannot think of the right relationship to use to automatically relate john to Doug.

        • 1. Re: contacts related to each other
          SteveMartino

          Please clarify.  How do you propose to "..select a related contact from the same table....without having to specifically select him..."?.

          You have a record, (John) with a portal showing a related record (Doug).  First of all, what piece of data makes them related? 

          What you probably need is the portal to be based on a second table occurrence of this table, joined by the 2 fields that define what makes them related (some 'flag' field with value that determine relationship, i.e. Company, City, etc). Then a button on the portal row can just GTRR using the same layout

          • 2. Re: contacts related to each other
            philmodjunk

            This is a "many to many self join". The relationship will look like:

            Contacts---<Join>----Contacts|Related

            Contacts::__pkContactID = Join::_fkContactID
            Contacts|Related::__pkContactID = Join::_fkRelatedContactID

            Contacts|Related would be a second occurrence of Contacts.

            You've probably already figured this much of the issue out. But the problem with it is that the join table entry will link John to Doug but it doesn't link Doug to John. But this data model can be used to make a two way link. The trick is to use a script to make a second Join record with the values in the ID fields swapped and then your link is now two way.

            Caulkins Consulting, Home of Adventures In FileMaking

            • 3. Re: contacts related to each other
              john@outdoorflooring.ca

              This is what I have and that is where I was going next so you just confirmed the solution. Thanks so much everyone for your contributions