View Rules - Force the DEFAULT view? Not working

Duncan Pederse1
Giga Expert

Has anyone ever used a View Rule to force users to see the 'Default view'? I checked in sys_ui_view and it seems the Default view does not have a name (it is empty). Therefore I do not know what to return from my view rule. I am returning an empty string, but it is still allowing the users to change the view.

8 REPLIES 8

Michael Fry1
Kilo Patron

One comes out of the box for Incident table. It looks like this:

find_real_file.png

The Machine
Kilo Sage

Or if you need to script it, this should work..

(function overrideView(view, is_list) {

// Add your code here
if(gs.getUser().hasRole('admin'))
{
answer = ''; // set the new view to answer
}
else{
answer = 'ess';
}


})(view, is_list);

Duncan Pederse1
Giga Expert

Those are not working for me. It appears if a user has the view_changer role, it overrides Advanced View Rule scripts?

Kajal Goti
Mega Guru

Hi,

you can enforce user to use 'Default View' based on your condition

Like this,

find_real_file.png

Please mark as Correct/Helpful if you find help worthy