- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 02:04 AM
Hi,
We need to force a view for all users with the ITIL-role on change and problem tables. They should not be able to switch views for these tables but we do not want to remove the view_changer role as we want them to be able to change views in other tables.
In the past i've accomplished this using an advanced view rule but Servicenow now states that this is is not going to enforce the view (see KB0997033).
Does anyone know how to accomplish this. That is, forcing a view on specific tables without removing the view_changer role from users?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 04:12 AM
So i managed to figure it out.
What the old "Advanced" view rules could achieve can now be done using Navigation handlers.
Examples from servicenow available here: Navigation handlers.
NOTE: There's an error in the example script where the GlideRecord variable does not match the variable later used in the script.
To set the view as forced use g_uri.set('sysparm_view_forced', 'true') .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 02:09 AM
I don't think it's feasible
If users have view_changer then they can switch the view
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 02:17 AM - edited 02-11-2025 02:21 AM
This is not helpful.
Edit: Since forcing a view for users with a view rule when not using advanced view rule works even with the view_changer role it should absolutely be possible. It has also worked in the past.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 02:21 AM
This is not possible.
1 way is use client script and check if view is changed then show info to user and change the view again using switchView()
Change Form View Client Script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 04:14 AM - edited 02-11-2025 04:14 AM
Hi Ankur!
I actually managed to get it solved. If you're interested you can view my comment set as solution for the question.
The Navigation handlers gives full ability to handle the views as the old Advanced view rules could.