Ajax button to save and move to next record

I am trying to create ajax button that would run few SQL commands and then move to the next record or just refresh the page to show next record.

I found an inflexible solution at the moment but would like to know if there is a better one

It seems like redirecting to the same application would be the correct solution, however, when you use sc_ predicted function and simply direct yourself to the same form, it loads up bank without pulling a record. I am thinking that this because action I take inside Ajax button makes currently opened record not qualify to be shown so form always comes up empty instead of loading next in line.

There is no refresh function, although page refresh using javascript is probably possible.

The only way I was able to get redirect to work was using exact url of the page stead of the application name, and to me it looks like something is broken in SC.
This is problematic as url has to be hardcoded for this code to work.

I am looking for a similar solution
Spent days on this

I need a multi record form with a single field ( a SKU number)
I would like to enter the number (or scan it in) , then enter a TAB, at which point the recrd should be inserted, the control goes to next record line for a new entry/.

I tried several approaches but each of them fails at some point

Any ideas?

Lew