3 Replies Latest reply on Jul 9, 2016 2:16 PM by Extensitech

    Students and Courses showing one Portal based on another Portal

    pademo57

      I have 3 tables: Students, Courses and a join table called j_Student_Course, because a Student can have many Courses and a Course can have many Students.

       

      Because each student has to have a report written each day on their behavior I then added a new table called Reports and connected it to the join table j_Student_Course.

       

      My problem is when I have a  Course layout which shows in one portal all the Students, I would like to click on a Student portal row and in the second portal show only the Reports that Student has.

       

      First of all, is this possible? If so, how do I get this to work? I tried putting a global field in Students and then tried to connect it to the Reports table but it doesn't work.

       

      Secondly, is there a better way to do this? Specifically, have I connected the tables correctly or should I do it another way?

       

      Thanks,

      Pademo57

        • 1. Re: Students and Courses showing one Portal based on another Portal
          Extensitech

          I've attached a file. Is this what you're trying to do?

           

          btw, instead of j_Courses_Students, how about "enrollments"?

           

          HTH

          Chris Cain

          Extensitech

          • 2. Re: Students and Courses showing one Portal based on another Portal
            pademo57

            Thanks Chris,

            That is exactly what I would like it to do.  So I had to use a FilterValues function to make this work?

             

            I'm not sure how this works but if you have the time I would appreciate a more detailed answer on how this works. But if you don't have the time I still really appreciate your answer.

             

            Thank you very much

             

            Pademo57

            • 3. Re: Students and Courses showing one Portal based on another Portal
              Extensitech

              When you set the "focus" key into a global, it's the same for every record. So we don't want to keep showing, say, Jane Doe's Shop class stuff while we're looking at the Physics class. Also, when you first get to a record, we don't want to just show no reports at all.

               

              So, the function for the focus calc is basically saying: "if we have a join record focused that's relevant to this record, go ahead and use it, but otherwise make the first join record the focus."

               

              I'm sure there are (at least) dozens of ways to accomplish what you're after, but this is a method I've used before, and seemed like it'd work for your purposes.

               

              Another way, for example, would be to not make your focus selection a global, so you wouldn't have to worry about linking to an irrelevant record. Another thought is to use "hide when" to have the reports portal just disappear if there's no (or no relevant) join record selected.

               

              You may also want to consider conditional formatting to highlight the record in the left portal that is the "focus" of the second portal, just for better clarity in the interface.

               

              So, lots of ways to skin this particular cat. The filterValues function, while it's very useful, isn't particularly magic.

               

              For the core thing, showing reports for a particular enrollment ("join"), it sounds like you were down the right path, with setting a global. It's a way to get past the (pretty reasonable) limitation where you can't show a portal within a portal.

               

              HTH

              Chris Cain

              Extensitech