- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 01:32 AM - edited 04-12-2023 01:56 AM
In Portals under My open incidents . i want on hold state records should be seen at top. and should be in Different colour. how to do this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:39 AM
See thats how it is when you comes to sorting.
When you say Descending then state values will be used to order and show under widget.
Now if you still want onhold to apprear first then you will need to set Resolved at lower order.
Eg: right now resolved - 6 , on hold - 3 and in progress -2
So when you set to descending the 6 will come first which is Resolved, you can change the value to something like 1 but less than 3 so that resolved incidents will go at lower side . I will not recommend this just to have this behaviour under this widget and impact of doing this is instance wide.
There is also other option by just by not considering resolved incidents under 'My Open Incidents' which can be done by adding same in filter condition at same location like below:
and then you will have on hold at top
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:26 AM
@sushantmalsure no its Not possible when we have state Resolved also . by descending means state resolved will come first
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:27 AM
have you tried doing it to Ascending ?
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:29 AM
@sushantmalsure Ascending Means State New will come first
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 02:39 AM
See thats how it is when you comes to sorting.
When you say Descending then state values will be used to order and show under widget.
Now if you still want onhold to apprear first then you will need to set Resolved at lower order.
Eg: right now resolved - 6 , on hold - 3 and in progress -2
So when you set to descending the 6 will come first which is Resolved, you can change the value to something like 1 but less than 3 so that resolved incidents will go at lower side . I will not recommend this just to have this behaviour under this widget and impact of doing this is instance wide.
There is also other option by just by not considering resolved incidents under 'My Open Incidents' which can be done by adding same in filter condition at same location like below:
and then you will have on hold at top
Regards,Sushant Malsure
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 04:08 AM
OOB you're out of luck. The order by functionality is neat, but doesn't allow you to specify something as important.
You can modify the Simple List widget to work in your way.
Around line 13 there's a <li> element that you'll need to modify.
The <li> element looks something like this:
<li ng-repeat="item in c.data.list track by item.sys_id" class="list-group-item">
You'll want to change it to
<li ng-repeat="item in c.data.list | filter:{top:true} track by item.sys_id" class="list-group-item" ng-style="{'background-color':'red'}">
Note that the <li> element contains a lot of stuff. If you've opened the widget in widget editor you can collapse it, but the most imporant thing now is to find the closing tag </li>. It's around line 44 before the ul element.
Now copy the whole <li> element and paste it right after again.
Now in the second li element do the following changes:
<li ng-repeat="item in c.data.list | filter: {top:false} track by item.sys_id" class="list-group-item">
It should now look a bit like this:
Now in the server side you'll have to add this after line 80 record.classname = gr.getRecordClassName();:
if(gr.state == '1'){
record.top = true;
}else{
record.top = false;
}
It doesn't really matter much where you do as long as it's after var record = {}; and before data.list.push(record);
Now what will happen is that you'll first have li elements for records that have state as 1. Then li elements for anything else. I've set the filter to record.top as you can easily then modify anything else to go on top as well by modifying the if else on server side.