The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Force specific view for users with itil role

oliolio
Giga Guru

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?

1 ACCEPTED SOLUTION

oliolio
Giga Guru

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') .

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@oliolio 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.

@oliolio 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.