Show currently selected record

When using controller.setSelectedIndex(index); if the record selected is not shown on the form, the form doesn’t scroll or move to show the selected record (the highlight just disappears off the screen).

I’m unable to find any method or property in the Controller, JSFoundset or JSForm to move the form to a selected record. Is there a property or method I am missing?

If you are using a framework there may different way to do this, but without a framework you can try:

controller.showRecords(singleNumber_pk:Number)

Load data into the form and shows the form, is a shortcut for the functions 'loadRecords' and 'show'.
controller.showRecords(foundset);

From your post I assume you are using a data grid, is that correct?

To scroll the grid to the selected record, you can use the function scrollToSelection():

elements.yourGrid.scrollToSelection();

The scrollToSelection() looks ideal. Thanks Joas.

I was a bit unsure on the showRecords() are I had already loaded in the records to the form, will read more into it swingman.

Really appreciate the feedback, it will make a huge difference to the operation of the app :)

If you have data in a grid, forget about my suggestion…