Readonly Breadcrumb

ashwani_eshoppi
Kilo Expert

I have created a module which shows up the received emails related to the logged in user.

But the issue here is that the user can click on the filters and remove the filters.

I checked the article

Restricting Filters and Breadcrumbs - ServiceNow Wiki

I tried creating a script include named 'sys_emailDisplayFilter' ,   and the function to set answer as true only for admin.

But when I impersonated as user with itil user, still the user can play with the filters/breadcrumbs.

How can I make the breadcrumb/filters readonly.

1 ACCEPTED SOLUTION

Try to do cache flush by cache.do and see if it fixes the issue


View solution in original post

17 REPLIES 17

ashwani_eshoppi
Kilo Expert

Hi Smruti,



Create a new script include with the name <tablename>DisplayFilter. The script section contains one function with the same name as the script include. Have your function set the global variable "answer" to either true (show the filters and breadcrumbs) or false (hide them)



Check this link for more info


http://wiki.servicenow.com/index.php?title=Restricting_Filters_and_Breadcrumbs#Suppressing_Filters_a...



I created Script include 'sys_emailDisplayFilter' and provided below code.



function sys_emailDisplayFilter() {



    if (gs.hasRole("admin")) {


          answer = true;


    }


    else


    {


      answer = false;


    }


    return answer;


}



Hope that helps! Please mark correct/helpful if it is.


Hello Ashwani,



I have gone through given link. I want filters to be available for all users.


So I created script include named incidentDisplayFilter and used below codes.



function incidentDisplayFilter() {


  answer = "true";


    return answer;


}



I am not able to get filter on Incident list page   for all users who are having no roles.


Please suggest.


Thanks,


Smruti


smruti
Kilo Contributor

Any update???


ashwani_eshoppi
Kilo Expert

Hi smruti,



What is your requirement here.. if you need the filters in breadcrumb to be available for all users, you do not need this script include, instead inactivate it and try again.I wrote this to hide the filter from the users who does not have admin role.


smruti
Kilo Contributor

Hello Ashwani,


My requirement is users having no role can also access filter But it is not available . So, I thought to try with scrip include.


Still I am not getting filter for users having no role.



Thanks,


Smruti