1 Reply Latest reply on Apr 22, 2013 10:30 AM by philmodjunk

    Portal - How to show a "child" record if it has two or more "parents"



      Portal - How to show a "child" record if it has two or more "parents"



           I have one table in the FM DB that has a parent-child entries. It was only one Parent to Many Children at first. Now I need to add the functionality that ONE Child can also have MANY Parents.  If for the CHILD record, in the field called "PARENTID" I enter more then one ID, then this record is no longer displayed in the Portal on my layout, the Portal does not understand that there are now Two IDs in that field.

           I have two Portals on my layout:
           1. Shows all the Parents - Parents Portal
           2. Child Portal - when I select a record from the Parents Portal then all the Children records show in the Child Portal

           Is there a way to have More then one Parent that when selected on the Parent Portal would show the same Child in the Child Portal?

           Thank you for your help!

        • 1. Re: Portal - How to show a "child" record if it has two or more "parents"

               This describes a many to many relationship. While you could enter more than one ID in the same field if you separate the values with returns, this is not the best option to use in most situations.

               Instead, use a third "join" table between the two:


               Parent::__pkParentID = Join::_fkParentID
               Child::__pkChildID = Join::_fkChildID

               Your portal then becomes a portal to the Join table instead of Child, but you can include fields from Child in the portal row when you place the portal on the Parent layout. But you can also place a portal to the join table on the Child layout to list parents.

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained