Webmethod java Service for Sorting doc list

while i am using the below IData Object for sorting
IDataUtil.sortIDataArrayByKey(itemList, keyField, IDataUtil.COMPARE_TYPE_COLLATION, null, sortDescending);

it sorts the numeric values based on the digit we given,

For example if we give 120,110,650,540 it wrks finee …

if we give 20,120,85,650,450 it given wrong sort list.

my requirement is sorting doclist…

is there any one know any other idataobjects is there for sorting??

appreciate ur comments…:slight_smile:

define input as list
use Arrays.sort(List);

Of course you have to check for numeric or non numeric.

Search the forums for previous posts on this topic.

that’s finee,for that i need to convert doc list to string list,then i need to chk numeric and non numeric and applying sorting logic for both in different manner.i am looking for some kind of inbuilt funtions,for direct sorting…like above i mentioned…

You can find “sortDocumentList” service in PSUtilities package…

Be careful with the sort in PSUtilities. When sorting numerically, it converts strings to doubles which may give unexpected results due to inaccuracies associated with using float/double.