Default Sort of the records in list view

Sachin57
Kilo Contributor

I want to make default sort on "SortNum" column for all the user, how can we achieve that. 

 

@Ankur Bawiskar 

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this link has the solution

you need to update the user preference record

How to change the default sort order on the Knowledge Result Sort Widget

Related List default ordering

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this link has the solution

you need to update the user preference record

How to change the default sort order on the Knowledge Result Sort Widget

Related List default ordering

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks @Ankur Bawiskar , It is working for me now.

Hii,

my query is, i have unique values and summing the disk_space value on unique value only and my problem is how the fetch the maximum values in that unique value means(how to get 2037.65 values in that) . plz sir write the code for fetching the maximum value in that unique value(only i want 2037.65)..

 

 

 var a=[];
var gr = new GlideRecord('cmdb_ci_computer');
gr.addEncodedQuery('manufacturer.name=Lenovo');
gr.query();
while(gr.next()){
a.push(gr.os.toString());}
var au = new ArrayUtil();
var newChangeArr = au.unique(a);
gs.print("No of OS" +newChangeArr.length);
gs.print("List of OS" +newChangeArr );

for(i=0;i<newChangeArr.length;i++){
gs.print("Array " +newChangeArr[i]);


var gr1 = new GlideAggregate('cmdb_ci_computer');
gr1.addQuery('os',newChangeArr[i]);
gr1.addEncodedQuery('manufacturer.name=Lenovo');
gr1.addAggregate('SUM','disk_space');
gr1.setGroup(false);
gr1.query();
while(gr1.next()){
gs.info(gr1.getAggregate('SUM','disk_space'));
}}

 

 

This is output:-

Script execution history and recovery available here


*** Script: No of OS7
*** Script: List of OSWindows 2000 Advanced Server,Windows 2000 Server,Windows 2003 Standard,Windows XP,Windows 2000,Windows XP Professional,Windows 2000 Professional
*** Script: Array Windows 2000 Advanced Server
*** Script: 9.31
*** Script: Array Windows 2000 Server
*** Script: 4.00
*** Script: Array Windows 2003 Standard
*** Script: 640.00
*** Script: Array Windows XP
*** Script: 2037.65
*** Script: Array Windows 2000
*** Script:
*** Script: Array Windows XP Professional
*** Script: 522.24
*** Script: Array Windows 2000 Professional
*** Script:

 

Hi @Ankur Bawiskar 

Ankur,

 

I wanted to show In progress records first in list view. Please let me know how can I achieve that