Force user to a specific view (i.e. ess user to an ess view)

thisismichaelb
Tera Contributor

How do I force an ess user to an ess view?   There must be something around roles I am missing.

 

View Rules don't seem to have the flexibility I need.   And I am able to do this with links, but what about an email link that goes out or gets passed around?   I've noticed users that hit those links go to the default/everything view and not an ess view.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Michael,



Check out https://wiki.servicenow.com/index.php?title=Restrict_Form_Views_by_Role



You'll need to build a global business rule (one of the few times you can't use a script include.) Check the one for incident list & form as an example.


View solution in original post

7 REPLIES 7

Chuck Tomasi
Tera Patron

Michael,



Check out https://wiki.servicenow.com/index.php?title=Restrict_Form_Views_by_Role



You'll need to build a global business rule (one of the few times you can't use a script include.) Check the one for incident list & form as an example.


Thanks Chuck, will give it a shot.   I always tend to shy away from the "not officially supported" articles.


Chuck Tomasi
Tera Patron

It's the only way I've found to work based on roles. It's also implemented in the base configuration. 🙂


hi I have created an UI action in approver form..." UPDATE RITM",



function displayRITMRecord() {


        var dialog = new GlideDialogForm('Review & Update ', 'sc_req_item');


        dialog.setSysID(g_form.getValue('document_id'));


        dialog.addParm('sysparm_view','Approver');     ---- it works only for ITIL users and not for ESS users. So, used the below global business rule.


        dialog.addParm('sysparm_form_only','true');


        dialog.render();


}



created a global business rule as below to show the APPROVER view( in RITM )   to ESS approver when clicks on UPDATE RITM.




// populate the default value for the caller


function sc_req_itemGetViewName() {


      if (gs.hasRole("itil"))


  {return;}


  if (view.startsWith("approver"))


      {return;}


  if (view == "sys_ref_list")


      {return;}


  answer = "approver";


}


function sc_req_item_listGetViewName() {


sc_req_itemGetViewName();


}



I dont see any luck in getting my APPROVER view shown to the end user through UI Action. Kindly help