Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GTRR and scrolling the screen

Featured Replies

Hi

When using GTRR to navigate to a record in the same list view layout, the destination record is displayed in unpredictable vertical locations on the screen. Sometimes it will be displayed at/near the top of the list or in the middle or right at the bottom of the screen.

 

Thus the user doesn't know where to look first to locate the record on the screen - it's annoying to have to visually scan the screen. Is there a way to force the target record to always display at/near the top of the screen, irrespective of whether it is down the list or up the list?

 

I know there is the Scroll Window script command, but I can't think how it can be used when you can't predict where the target record will be displayed.

 

Thanks in advance.

David

You can query the record number and the found count, and you can query or set the window dimensions.

 

You know the height of the layout's header and body part.

 

These parameters should allow you to write a script like the following:

Go to Related Record [ From table: “Events”; Using layout: “Events_Chart” (Events) ] [ Show only related records; New window ]
Set Variable [ $header; Value:215 // hardcoded ]
Set Variable [ $body; Value:41 // hardcoded ]
Set Variable [ $RN; Value:Get ( RecordNumber ) ]
Set Variable [ $offset; Value:Div ( Get ( WindowContentHeight ) - $header ; $body ) - 1 ] 
If [ Let ( $goto = $RN + $offset ; Get ( FoundCount ) >= $goto ]
  Go to Record/Request/Page [ $goto ] [ No dialog ]
  Scroll Window [ To Selection ]
  Go to Record/Request/Page [ $RN ] [ No dialog ]
End If

Not extensively tested, so tweak and twiddle to your heart's content.

 

And then there's the FM13 feature to format the Active Row's appearance …  :smile:

Is there a way to force the target record to always display at/near the top of the screen, irrespective of whether it is down the list or up the list?

 

No, that's not always possible. The last record in the found set cannot scroll higher than the bottom of the window. If your window displays say 10 records, then the last 9 records will never appear in the top position of the window.

 

 

That said, if you add the following three steps to your GTRR script:

Set Variable [ $recNum; Value:Get ( RecordNumber ) ]
Go to Record/Request/Page[ Last ]
Go to Record/Request/Page [ $recNum ][ No dialog ]

then the selected record will become the top record displayed in the window - if possible.

 

 

If it's important, considering isolating the selected record as the only record in the found set, or highlight it.

 

  Scroll Window [ To Selection ]

 

Scroll Window [ To Selection ] scrolls to the currently active field. If no field is active (as in your script) then it does nothing. I believe that your script works by coincidence - just by going to the originally selected record from lower down in the list.

  • Author

Thank you both. Comment, I think your suggestion does the job, taking note of your caveat.

Regards

David

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.