I think I am losing my mind. The code in these two triggers on the Sales Order List is causing a HUGE delay in one of my customers' system. I just can't figure out what this is supposed to do, especially the OnNextRecord trigger. It is doing next(1) and next(-1), seemingly going through all the records up and down, but I don't understand why it's there. When I remove the triggers, the page is empty, it just does not show any records at all. How does a list page with no code not show the records in the table?
I feel stupid for asking, but can someone explain what this code is doing? I don't need suggestions for performance improvements, I want to know about this code.