Ad-Hoc Sorting on Multiple Columns

Overview

At runtime it is possible to sort on more than one field via passing parameters through 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 a single application to display data in multiple ways, thus eliminating the need for multiple versions of the same application.

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.

Let’s 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

The list of parameters involved with this feature are as follows:

  • sort_typ=0 – Can be equal to 0 or 1. A value of 0 will sort in descending order, a value of 1 will sort in ascending order.
  • cur_sort_col=FIELD1,FIELD2 – a list of comma separated field names. The application will sort by the specified fields, going off the order they were specified in (left to right).
  • reorder=Y – tells the program that reorder sort parameters are being passed.

Once implemented, the link will look like this:
DD.I00010s?sort_typ=0,1&cur_sort_col=FIELD1,FIELD2&reorder=Y

where

  • DD is the name of you data dictionary / library
  • FIELD is the name of a field in your application that you want to sort by

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

Updated on April 11, 2023

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