2 Replies Latest reply on Jul 4, 2014 6:02 PM by abunce515

    showing related records on same layout by choosing from a portal

    abunce515

      Title

      showing related records on same layout by choosing from a portal

      Post

           Hey all - Thanks as always for the help.

           I have been digging around and am having an issue even figuring out where to get started on this one.  SO if someone could point me in the right direction I will get started and then pop back in when i get stuck.

           I am looking to created a layout for my contacts list that would show a list of contacts, then show that data on the same layout by clicking on it.  similar to what you see with an iPad.  on the left is a list of names and on the right is the information for the person selected on the left.

           I would assume i need a self join relationship for my contacts table and then a portal to show the list of contacts... but that's about all I can figure out.  

            

           any direction would be great, thanks.

            

        • 1. Re: showing related records on same layout by choosing from a portal
          philmodjunk

               Think in terms of two tables, one for your layout and one for you contacts data and then use two different occurrences of your contacts data for both your portal and your "detail" view of the selected record in your portal.

               Contacts|All>-----LayoutTable-----Contacts|Selected

               Contacts|All::anyfield X LayoutTable::anyfield

               Contacts|selected::__pkContactID = LayoutTable::_fkSelectedContact

               You'll need a minimum of one record in your LayoutTable for this to work. Contacts|All and Contacts|selected are two occurrences of the same table.

               On your Layout, based on the LayoutTable, add a portal to Contacts|All and it will display all contacts. You can use a different relationship or a portal filter to display subsets of your contacts, but we'll stick with all contacts in this example. THen add the fields for name, address, etc to your layout from Contacts|Selected.

               Put a button in your portal row or use button Setup to turn your fields in the portal row into a button. Set it to perform this script:

               Set Field [LayoutTable::_fkSelectedContact ; Contacts|All::__pkContactID ]

               That should be it. If you don't see the detail view fields automatically updating, try adding a refresh window script step to the above one step script.

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

          • 2. Re: showing related records on same layout by choosing from a portal
            abunce515

                 Brilliant!  Thank you - works great