Business rules to sort the Records in a Table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2016 05:54 AM
Hi Folks !
Is there any business Rule to sort the records in the Table which shows the latest data first. or is there any other option to achieve the same.....
Thank you !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2016 06:03 AM
check this wiki article out, describes how to set order on your modules and lists
Controlling the Sort Sequence Used to Display Lists - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2016 06:06 AM
Hi Karthik,
Are you wanting to sort the records in the list view or while writing the GlideRecords in script?
You can technically achieve what you want by a query business rule with script something like below.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.addQuery('ORDERBYshort_description'); // short_description is the sample field that i have selected
})(current, previous);
But i really do not understand the purpose of this use case.
Thanks
Srinivas