Dynamic subpages GetNext, GetPrevious

I have a database. On a dynamic page I display a list of the records (some global info) and allow the user to apply filters in such a way they can go quickly to the list they want.
On the list displayed (filtered or not) they can click on a line and then move to another dynamic page giving all the details of the line selected.
I want to add a functionality that, from this detailed page, allows the user to move to ‘Next’ or ‘previous’ page, but only on the one they have filtered on the global page.
Using the GetNextPage, GetPreviousPage, allows to navigate among all records. I do not know how to navigate only on the filtered items of the global page!
Any tips on how to achieve this?
Thanks
Claude