Ad-Hoc Sorting on Multiple Columns


At runtime it is possible to sort on more than one field via parameters over the URL, by doing this developers can easily reuse applications to satisfy many end user sorting requests. Being able to sort on multiple columns allows an application to display data in multiple ways, eliminating the need for multiple applications.

For instance, multiple column sorting can be helpful when there are users that need to see the same data sorted in different ways. Instead of having to build multiple applications and use different sequencing to achieve the desired sorting, the developer can build a link to the application passing the sorting parameter in the URL. Lets say I have user A who needs to see the application sorted on column 1 ascending and column 2 descending, I simple create the link for this user and place it on a menu or send the link to the user directly. Now I have user B who needs to see the same application but sorted on column 3 descending and column 5 ascending, all I have to do is create the link with the proper parameters and give the user access to the link. The developer can create as many links as needed.

The templates that support this feature are: Multiple Record Retrieval, Display and Maintain Rows, and Grid Update Maintainer.

URL Parameters

sort_typ= a value of 0 will sort in descending order, a value of 1 will sort in ascending order.

cur_sort_col= list of comma separated fields, the order of the fields will match the order of the values for sort_typ. First value in sort_typ will correspond to the first field name in cur_sort_col, and continue with the rest of fields in the order they are included.

reorder=Y  tells the program that reorder sort parameters are being passed.

The link will look like this:

DDATA = data dictionary or library
FIELD1 = the name of the field in your application
FIELD2 = the name of the field in your application

These parameters are case sensitive, make sure to use the same case sensitivity as in the example.

Updated on October 4, 2021

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support