The CreatorCon Call for Content is officially open! Get started here.

Set form view for a role

joaosantos
Mega Expert

I created a role "service_desk" and i want everyone with this role to use the default view when accessing incident table. I was able to do this when opening an existing record but it does not work when creating a new one...the ess view is being used

1 ACCEPTED SOLUTION

Have you checked to see if the incident functions business rule is getting in the way? Replace YOURINSTANCE with your instance in the URL below.



https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_script.do?sys_id=68c334efc0a80164016c1bce9b63...


View solution in original post

10 REPLIES 10

But it is working when i have checked..



as per above script which i have given.


find_real_file.png



find_real_file.png



Regards,


Sadasiva



Please mark helpful/ correct based on the impact


For new incident also it works..


find below..


find_real_file.png



Regards,


Sadasiva



Please mark helpful/ correct based on the impact


This is what i have



(function overrideView(view, is_list) {


//Force non-itil users to use the ess view


gs.log('is_list: ' + is_list,'debug view rule2');


gs.log('view: ' + view,'debug view rule2');


if (gs.hasRole("itil"))


{


gs.log('test 1','debug view rule2');


return;}


if(gs.hasRole('admin'))


{


gs.log('test 2','debug view rule2');


return;}


if (view.startsWith("ess")&&!gs.hasRole("service_desk"))


{


gs.log('test 3','debug view rule2');


return;}


// do not change view if it starts with sys_ (e.g. sys_ref_list)


if (view.startsWith("sys_")&&!gs.hasRole("service_desk"))


{


gs.log('test 4','debug view rule2');


return;}


answer = ""; // set the new view to answer


})(view, is_list);



find_real_file.png


find_real_file.png


find_real_file.png


Have you checked to see if the incident functions business rule is getting in the way? Replace YOURINSTANCE with your instance in the URL below.



https://YOURINSTANCE.service-now.com/nav_to.do?uri=sys_script.do?sys_id=68c334efc0a80164016c1bce9b63...


Anurag Tripathi
Mega Patron
Mega Patron

Hi Joao,



Why dont you try looking at view rules



http://wiki.servicenow.com/index.php?title=View_Management#gsc.tab=0


-Anurag