Control Default Sort Order of Reference List and restrict it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2017 09:16 PM
Hi Community,
Seems like doing following does the job except I need to restrict the sort as well
2.3 Default sort order
The system automatically sorts lists that meet one of the sort order criteria.
If there is a user preference specifying the sort order for the table, the system sorts by the field listed in the user preference.
If the table is the Task table or any of its extensions, the system sorts by the Number field.
If the table contains a field with the attribute isOrder=true, the system sorts by this field.
If the table contains an Order field, the system sorts by this field.
If the table contains a Number field, the system sorts by this field.
If the table contains a Name field, the system sorts by this field
is there a way I can restrict reference column once sorted?
Thanks in advance
AK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2017 09:21 PM
4 Setting the Default Sort Order in the System Dictionary
Important: The defaultsort setting might not work as expected. A product defect has been opened to address this issue. See KB0547835.
An administrator can set the sort order of records displayed for a table in the System Dictionary when there is no other sort specified. This is the sort order presented to all users initially. Once a user sorts a list, that user preference is saved, and the list is always sorted for that user based on the previous sorting preference.
Hope this helps you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2017 09:26 PM
Hi Amdadl,
Please refer below link. Thank you!
Controlling the Sort Sequence Used to Display Lists - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2017 10:22 PM
Hi,
Can you try writing a Before query Business Rule on the Reference Table to restrict the sorting for the other users with the default sort available for all done by the Admin in the script:
Please create a Before Query business Rule on the Reference Table. For example In the below script I have restricted the sorting i.e. the latest created records would always be at the top for all the Users on the project Table:
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var query = 'ORDERBYDESCsys_created_on';
current.addEncodedQuery(query);
})(current, previous);
Hope this helps.Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2017 12:17 PM
Hi,
If your query is Resolved please mark the answer as correct and close the thread.
Regards,
Shloke
Regards,
Shloke