Add sort button is not working as expected in sys_ux_list

harinya
Tera Contributor

HI 

I'm working on a requirement where I need to set a default descending sort order for a specific column in a UX List (sys_ux_list)

When I try to add the sort option for the list, it redirects me to create a new record. Has anyone else faced this issue or is aware of why this might be happening?

Thanks in advance!

harinya_0-1746865160253.png

 

5 REPLIES 5

Sohail Khilji
Kilo Patron
Kilo Patron

Use a Before Query Business Rule..,

 

If you need to enforce a specific sort order for all users, you can create a Before Query Business Rule on the relevant table. For example, to sort records by the updated field in descending order:

 

(function executeRule(current, previous /*null when async*/) {
var query = 'ORDERBYDESCupdated';
current.addEncodedQuery(query);
})(current, previous);


This script ensures that the list is always sorted by the specified field in the desired order.


ā˜‘ļø Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

if i am trying to created business rule sys_ux_list i have record in risk manage workspace but i need list cloumn updated value needs to be sorting that is in different scope
it is not allowing me to do that

 

Vasantharajan N
Giga Sage
Giga Sage

@harinya - Once after you create a record in sys_ux_list. Please use "Data Management > Update Jobs" to update the condition for the sys_ux_list record that you created or Use Background script to update the condition.

 

For example,

In the below example, i've added the filter active is true and Sort the number column in desc order for Issue[sn_grc_issue] record. 

var gr = new GlideRecord("sys_ux_list");
gr.addQuery("sys_id", "f5febaeffbd922105f22f49d3eefdcae"); //sys_id of your newly created UX List
gr.query();
if (gr.next()) {
    gr.condition = "active=true^ORDERBYDESCnumber"; // FIlter consition with sort query
    gr.update();
}

 


Thanks & Regards,
Vasanth

HI Thanks for Response to both @Vasantharajan N @Sohail Khilji 
But here i don't want this to be one time action in dev i can run the background to sort but for all instances it's not correct right