Ordering Recordlist

Hi All,
I have an RecordList containing 10 columns and records in that list is in any order.
Now i want to order the RecordList on 3rd and 5th Column in the record.

Can anyone suggest me how to do the same ??

Hi Atul,

Refer to Java API supplied by webmethods, in this there is a method public static IData sortIDataArrayByKey(IData dataArray,
java.lang.String key,
int compareType,
java.lang.String pattern,
boolean reverse)

in IDataUtil class through which you can sort.


I think the IDataUtil.sortIDataArrayByKey method only uses a single key to sort by. To sort on multiple keys you will need to concatenate one or more “columns” of your recordlist together and then sort on that composite key.

It would be nice if the IData object implemented the Comparable interface. I’m not sure how difficult it would be to simulate this.