5 Replies Latest reply on May 10, 2009 10:20 AM by ralvy

    Making the portal scroll to a particular record

    ralvy

      Title

      Making the portal scroll to a particular record

      Post

      I have a solution that has different layouts with a portal on each one, where each portal is sorted by Agent Name. In each portal, there are a couple buttons in each portal row, where each button allows the user to move to a different layout for that particular Agent. However, the layout they land on will also have a portal of Agents. What I need is for the user to not see the the portal in the next layout reset the scroll bar. I want to be able to have the button script load the next layout with the chosen Agent appearing at the top of the portal, or at least be clearly present in the view without further scrolling.

       

      I guess I need the script to find the portal row that houses the given Agent in the layout that's called, and then go to that portal row. I don't see how a script can find what portal row a given record is on. That might help.

        • 1. Re: Making the portal scroll to a particular record
          KIDO
             <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

          Hi ralvy

           

          If I may suggest, work around the functions:

          Go to Related Record in your portal, and

          Get (PortalRowNumber)

           

          If you don't want the users to see the other agents make a Find to isolate the agent, like this:

          Set Variable [ $myAgent; yourTable::Agent Name]

          Enter Find Mode[]

          Insert Calculated result [Select; yourTabel::Agent Name; “==” & $myAgent]

          Perform Find[]

          ….

          The Found Set contains only the selected agent. Make sure the equal signs are not separated.

           

          Good luck

          • 2. Re: Making the portal scroll to a particular record
            ralvy
              

            Thanks for the reply, Kido. The problem is that when the user presses a button on the selected Agent in the portal, they are taken to a different layout where another portal lives, allowing them to choose a different Agent in that portal if they want. So I don't want to use a GTRR in this case. While they are in the second layout, they see the record of the Agent they chose in the first layout (via a global field), and can edit it, etc.

             

            But when the second layout is loaded, the portal scrolls to the top of the list, many times leaving the Agent's record in a lower portal row that can't be seen without scrolling again.

            • 3. Re: Making the portal scroll to a particular record
              KIDO
                

              Hi ralvy

               

              If the portal in your second layout displays same data as the one in first layout, then the portal row number will be the same regardless the number of visible rows in each portal.

               

              You can  capture the row number into a variable and use in the button script using Go to Portal Row. This will highlight the selected agent in the portal. You can work around to position the agent highlighted in the top portal line (portal row + [nr of lines in portal - 1]; portal row).

               

              See if it helps.

               

              • 4. Re: Making the portal scroll to a particular record
                KIDO
                   <!--            @page { margin: 2cm }           P { margin-bottom: 0.21cm }        -->

                ….

                 

                Even better,,,

                 

                Set Variable [$mypr; Value: Get (PortalRowNumber) ]

                Go to Portal Row [Select; Last]

                Go to Portal Row [Select; No Dialogue; $mypr]

                 

                … this will scroll your portal window down and then up, showing your selected agent on the top line of your portal.

                • 5. Re: Making the portal scroll to a particular record
                  ralvy
                     Thanks, Kido. This works fine!