8 Replies Latest reply on Dec 17, 2013 12:38 PM by philmodjunk

    Display all related records instead of just one record at a time.

    AbdoulBaldé

      Title

      Display all related records instead of just one record at a time.

      Post

           Hi, 

           I have the following Tables:

      Get Informed Themes ::(_kp_Get Infromed_ID; Get Informed_Label; Selected_Get Informed_ID

           and Get Informed::(_kp_Content_ID; Content_Label; Content_Label_ID; Content_Details; _Get Informed _Label; _kf_Get Informed_ID)

           I have linked Both tables using Get_Informed_ID.

           My Layout is based on Get Informed Theme Table. 

           On my Layout I have created a button for each Get Informed_Label with the following script (Please see screenshot). 

           I've also created a portal where the Content (Content_Details) will be displayed once you have selected a Get Informed Theme. 

           My issue is that selecting a Get Informed Them only displays the first related from the Content_Label field. I would like to display all of the Content_Label records for each Get Informed Theme button so that the user can click on a Content_Label (which is in reality a subcategory of a Get Informed_Theme) to display the Content_Details. 

           Could you please advise. I 'va added a screenshot of both script and Layout. Thanks. 

             

            

            

            

      Screen_Shot_2013-12-17_at_11.06.45_AM.png

        • 1. Re: Display all related records instead of just one record at a time.
          AbdoulBaldé
          /files/3cff54b1c0/Screen_Shot_2013-12-17_at_11.07.29_AM.png 1037x478
          • 2. Re: Display all related records instead of just one record at a time.
            philmodjunk

                 I'm puzzled by your script. As I understand it, you want to be able to select different groups of records from Get Informed so that they appear in your portal. But your script is finding different records in the Get Informed Themes table, not records from the Get Informed table.

                 Does that mean that you have one Get Informed Themes record for each Content Label button?

                 If not, What does one record in Get Informed Themes represent?

            • 3. Re: Display all related records instead of just one record at a time.
              AbdoulBaldé

                   Hi,

              Does that mean that you have one Get Informed Themes record for each Content Label button?

              If not, What does one record in Get Informed Themes represent?

              ==>No. I have several Content Label for each get Informed Themes. I created the Get Informed Table in order to be able to link the _kp_Get Informed_ID from this Table to the _Kf_Get Informed_ID from Get Informed Table. which will enable me to use portals. 

                   I had a similar situation where I wanted to display all the Floor Level Rooms by Clicking a Floor level number so I created 1 Table with just the Floor_level_ID and the Floor Level Name and another Table with the list of the rooms in the building (Room_ID; Room_Label; Floor_level_ID). By using the same script, I was able to display all rooms by Floor Level and navigate through the Floor Levels. 

                    

                   Is it any clearer? Thanks. 

                    

              • 4. Re: Display all related records instead of just one record at a time.
                philmodjunk

                     It explains why your script doesn't work as it is finding the wrong records to do what you want.

                     But you didn't answer this question:

                     What does one Get Informed Theme record represent? You've indicated that it doesn't represent a specific content label, but what DOES it represent?

                     To take on the same question from a different direction, when you click a button for a content label, do you want to see content with the selected content label for just the current Get Informed Theme record or do you want to see every record from Get Informed that matches that Content Label?

                     Both are possible, but I still do not understand the basic setup you have here nor the purpose of the two tables.

                • 5. Re: Display all related records instead of just one record at a time.
                  AbdoulBaldé

                       The get Informed theme only contains Get Informed_ID and Get Informed_Label (This field only has the 6 records representing the 6 different Get Informed categories. Nothing else. This table was just created to allow me to link it with the Get Informed Table containing the information I want to display. 

                       In other words, when clicking a button Get Informed_Label (Let's say it is the title of the paragraph) I want to see all Content_Label related to the Get Informed_Label. AND When I click on a Content_Label, I want to show the related Content_Details. 

                  • 6. Re: Display all related records instead of just one record at a time.
                    philmodjunk

                         Then a find isn't going to do it. You can set up your portal with either a filtered relationship or a portal filter calculation to limit the related records shown in the portal to a selected content label.

                         A key question that can determine which option is the better one to try:

                         What do you want to see in the portal if no button for a content label has been clicked yet?

                    • 7. Re: Display all related records instead of just one record at a time.
                      AbdoulBaldé

                           I would like the first Content detail field and its associated Content label to be displayed. But I also would like to have all Content Labels displayed so the user can click on it to view the content. 

                           Please see screenshot. Please Note that both Content_Label & Content_Details were part of a portal. I just moved the Content_Label Field outside the portal. 

                           Could you please advise. 

                            

                           Thanks. 

                      • 8. Re: Display all related records instead of just one record at a time.
                        philmodjunk

                             But with your portal to a related table, there isn't necessarily any record for any given content label unless you have taken steps to ensure that during data entry.

                             I am reading your last post to mean that there never will be a state of "no content label specified", but that you will have an initial selection of the first button's content label.

                             So add a field to Get Informed Themes named "SelectedContentLabel".

                             Change the relationship between Get Informed Themes and Get Informed to be:

                             Get Informed Themes::_kp_Get Infromed_ID = Get Informed::_kf_Get Infromed_ID AND
                             Get Informed Themes::SelectedContentLabel = Get Informed::Content_Label

                             Your buttons can use Set field to set the SelectedContentLabel to specific values to change which records appear in the portal.

                             OnRecordLoad can perform the same type of script to automatically set SelectedContentLabel to the same value as though the first button were clicked in order to start each record out with the first content label already selected.