How to make a default filter condition as non editable for users in List Control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 12:56 AM
Hi All,
Can we make the default filters non editable for specific users in ServiceNow?
Thanks,
Francis Xavier K.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 01:08 AM
Hi Francis,
A default filter cannot be made un-editable but you can try Before query business rule to apply filters for filter based on the user. That cannot be overridden by users.
Here is sample script that will lead you in the right direction. [you need to get an idea and write your own]
(function executeRule(current, previous /*null when async*/) {
var query = 'active=true^u_parentISEMPTY';
if(gs.action.getGlideURI().get('sys_target')=='change_request' && gs.action.getGlideURI().get('sysparm_type')=='M2MList' && gs.action.getGlideURI().get('sysparm_processor')== 'M2MList'){
current.addEncodedQuery(query);
}
})(current, previous);
We had created a custom related list on change form and filtered CR those were active and had a parent. It is applying filters based on parameters passed in URL. You can adjust this as per your needs.
Thanks & Regards,
Sharjeel
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 01:32 AM
Hello
Do you want something like this? Go to list Layout and head into List Control.
Inside make filter roles to Admin
Now ITIL users wont be able to filter on your respective Table, if this is what you were looking for?
Else proceed to Query Business rule like how Muhammad explained above.
Please Mark as ✅ Correct if this solves your issue and also mark ???? Helpful if it helps resolve your problem.
Thanks,
Saji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 06:52 AM
Hi Francis,
Please confirm if your issue is resolved so that you can close this open thread which can be beneficial for others in the Future.
Or do let us know if still any open queries.
Thanks,
Saji

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2020 01:36 AM
Hi,
You can configure list control and there you have option "Fitlers", there you can select the roles who can access it.