I have many layouts that are basically a list view with buttons that are used as column headers. When a column header button is pushed, it sorts the field in that column. This done simply by sending a script param that identifies which column header button is pushed and the script If/Else's until it finds a match. It then sorts on the appropriate field. It is currently only able to sort in one direction only. Users expect to toggle the sort order (ascending/decending) each time the column header button is pressed. GetNthRecord can tell me which order it is currently sorted in. I can use brute force to make this happen, but I have a lot of fields and a lot of list view layouts. It would be a lot of work.
I would like to pass the name of the field to a script and have it set a variable to something I can test on to determine if the value of the first record of that field is greater than the value of the last record in the found set.
Or, if there is a better way, please tell.