Add sort button is not working as expected in sys_ux_list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-10-2025 01:20 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-10-2025 03:28 AM - edited ā05-10-2025 03:29 AM
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....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-10-2025 04:59 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-10-2025 04:27 AM
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-10-2025 04:57 AM
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