1 Reply Latest reply on Aug 23, 2012 10:18 PM by philmodjunk

    Finding the line number for a record in a portal



      Finding the line number for a record in a portal


      I have two tabs, one with a portal sorting ascending and one with a portal sorting descending.  In each portal, the current record is highlighted in the portal with conditional formatting.  Each portal is 12 lines long before you need to scroll down further.  I have a script which will toggle between the tabs for ascedning or descending.  However, if my current record is beyond the first 12 lines of the portal upon toggling from one tot he other, I have to scroll down to see that record in the portal.  How can I script such that the current record always shows in the portal as I toggle between them?  (I have a good script that works well within the same portal when I select a record on the portal that is greater than the portal lines shown, but it does not work when I toggle portals as I lose the portal focus when I toggle bwtween portals).

        • 1. Re: Finding the line number for a record in a portal

          Use a script trigger, I think OnObjectEnter on the portal object will work, with Get ( CurrentPortalRowNumber ) to save the row number in a global field. Your script can then use go to object to put the focus on the other tab's portal and then go to portal row with a reference to the global variable to scroll the portal row into view.

          Unfortunately, while this makes the portal row visible, it can't always position the selected portal row in exactly the same position as was shown in the other portal.

          There is a way to use calculation fields and global variables or fields to dynamically sort a single portal instead of using two portals. This method isn't always feasible--the portal can be slow to update due to sorting on an unstored field, but does avoid the issues you are having here.