Issue with sorting the records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 10:46 AM
Hi Team,
I'm facing an issue in sorting the records.
For eg. I have 6 records of different change types and their count like "Normal - 2", "Emergency - 1", "Standard - 3".
I don't want the sort based on alphabetical asc or desc. I want customized sort to be as Normal - Standard - Emergency.
How to get the records on a custom sort?
Any help or idea is appreciated.
Sujatha V.M.
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2024 10:33 PM
@AshishKM Thank you for your inputs but custom field creation isn't allowed hence didn't go ahead with your approach.
I had used script include and implemented the logic to sort and concatenate. It was listing the records as expected.
Once again thank you for your help rendered towards it.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 06:08 AM
Thanks for reply, would you like to share this custome implementaion.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2024 06:26 AM
@AshishKM Sure! Why not!
The approach I had used here is, all these change requests are listed as agenda items on the CAB Workbench which shows up in a mixed view conducting the CAB meeting and weren't aligned.
(i.e) based on the order but not based on types and custom field.
1. Fetched all the change records and stored it in an array.
2. Used "for loop" to fetch the records based on change type and sort within the loop based on alphabetical order for the custom field value and they are saved in another array.
3. Concatenate the sorted arrays in the order we would like to display.
E.g. var allRecs = [];
allRecs = emergency.concat(normal, standard)
4. Following which the order is set to display.
Results in the CAB Workbench under all pending items, will show as "Emergency - Normal - Standard" types with an incremental order along the custom field values in alphabetical order.
Thanks,
Sujatha V.M.
Sujatha V.M.