0 Replies Latest reply on Jun 19, 2017 1:50 AM by iking42

    Centering A Record Of Focus In A List View

    iking42

      I use a small subscript to move the list focus to approximately the center of the displayed records window. If I execute the script from a button as a standalone it does exactly what I would expect. But, when executed as a subscript it does nothing unless I insert two 'Pause" steps. I was hopping version 16 would address this anomaly but it has not. My workaround functions but leaves the basic question of why unanswered. Does anyone understand this anomaly enough to educate this country boy?

       

      Works as standalone script but does nothing when run as a subscript.

      Pre-existing conditions: $$Offset = 24

      Set Variable [$CurrentRow; Value: Get (RecordNumber)]

      Set variable [$UpperNumber; Value: Int($CurrentRow + $$Offset/2)]

      Set variable [$LowerNumber; Value: Int($CurrentRow - $$Offset/2)]

      Go to Record/Request/Page [With dialog:Off; $LowerNumber]

      Go to Record/Request/Page [With dialog:Off; $UpperNumber]

      Go to Record/Request/Page [With dialog:Off; $CurrentRow]

      Exit Script [Text Results: ]

       

      Works as a standalone script and when called as a subscript.

      Pre-existing conditions: $$Offset = 24

      Set Variable [$CurrentRow; Value: Get (RecordNumber)]

      Set variable [$UpperNumber; Value: Int($CurrentRow + $$Offset/2)]

      Set variable [$LowerNumber; Value: Int($CurrentRow - $$Offset/2)]

      Go to Record/Request/Page [With dialog:Off; $LowerNumber]

      Pause/Resume Script [Duration (seconds): 0.1]

      Go to Record/Request/Page [With dialog:Off; $UpperNumber]

      Pause/Resume Script [Duration (seconds): 0.1]

      Go to Record/Request/Page [With dialog:Off; $CurrentRow]

      Exit Script [Text Results: ]