2 Replies Latest reply on Sep 29, 2010 5:27 PM by EltonHo

    Master-Detail Portal

    EltonHo

      Title

      Master-Detail Portal

      Post

      Hi all,

      My layout has 2 portals that tried to display 2 related tables. I found that when I navigate the master portal (the 1st portal), the second portal cannot display respective records of the selected one in the master accordingly. Why? How can I make it work?

      Anyone can help? Thanks in advance.

      Best regards,

      Elton

       

        • 1. Re: Master-Detail Portal
          philmodjunk

          So you have three tables:

          LayoutTable---<Master----<Details

          LayoutTable----<DetailPortal (DetailPortal is a second table occurrence of Details.)

          With scripting support, you can do this.

          LayoutTable::PrimaryKey = MasterPortal::ForeignKey
          LayoutTable::gSelectedDetailID = DetailPortal::DetailID

          On the layout, the Details portal should refer to DetailPortal, not Details.

          Either format all the fields in the Master Portal as a button or put a button in the row that performs this script:

          Set Field [LayoutTable::gSelectedDetailID ; MasterPortal::DetailID ]
          Commit Record

          You can even use conditional formatting to "highlight" the portal row of the selected MasterPortal record.

          Note: gSelectedDetailID is most often defined as a global field though this is not strictly necessary.

          • 2. Re: Master-Detail Portal
            EltonHo

            Hi Phil,

            Thanks for your comment.

             

            Best regards,

            Elton