include orderby in query business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-16-2018 11:23 PM
Hi All,
I have been trying to include orderBy in my query business rule and somehow I'm unable to make it work.
Can someone guide if we can use orderBy in the query business rules?
Code Snippet:
var qc = current.addQuery('active','true').orderBy('state');
Thanks,
Srikanth Varma
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2024 09:26 AM
How does the before Business Rule on User Preference work? I've tried setting it and nothing happens so when users change the sort order it is a permanent change for them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 12:26 AM
Try something like this:
var qc = current.addQuery('active','true');
qc.orderBy('state');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 01:27 AM
I tried this but no luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2018 01:32 AM
Is at least the list coming back with Active=True?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2025 05:22 AM
Though it is an old query but to help community further I would like to add some of my suggestion,
1. Do check that whether any already sorting is happening on your list view or not.
2. In my case I was experiencing same issue, later I checked that whenever I am opening my incident list, it already doing some sorting which you can also confirm from the URL: "incident_list.do%3Fsysparm_filter_pinned%3Dtrue%26sysparm_query%3D^ORDERBYDESCsys_updated_on".
3. Here above my incident list already sorted by updated on that was the reason the query br for order by was not working!
4. So you can try just "your-instance.com/incident_list.do".
5. Hope this will work.
QUERY BR SCRIPT -
current.addQuery('assigned_to', gs.getUserID());
current.orderByDesc('priority');