logo

NJP

Servicenow Portal (Part 14) - Read Only Filter

Import · Feb 02, 2020 · video

like um everyone I'm back with another video and today I'll be showing you how to make your filter read-only by adding few CSS so here this is my page where currently I can edit any edit my filter and/or add in this filter currently I'm not having any filter so to make your work easier I'll just I have opened all the pages all the widgets for you so for this visit this for this incident table this is my particular widget URL definition and if you want to add any filter I have already showed you so if you want to add any filter you need to go to the data table of that particular incident widget so if I open incident data table by just pressing ctrl + your right click so if you open widget in editor so this is the widget after this widget in this widget if you go there is ing data table which I have added if you haven't watched my video kindly go and watch my previous videos for this one and if I open this then if you see data dot filter is already available in this incident data table so what I need to do this is the this is out-of-the-box thing which they have added but I need to customize this by adding I want the filter to be to have only state which is of new which is new so state with new incidents I want the state is equals to 1 we know that new is denoted by 1 you can go and check in the incident table if you want so I will just say of this and if I just refresh just pay and we can see that state equals to you is coming because I've added state equals to 1 and but if you see that we can edit this filter by anything and which is not my criteria my criteria is that this filter should not be changed by anyone no one no one can change this filter it should be totally read-only so how to do that it's quite simple you can add the CSS which I am going to add in the page or in a particular widget it's up to you I'll be adding in the page so this is the page you can open the page in the same way as you can or you have opened the widget region in a detail you can just open the page in designer or you can go from SP underscore page you can open the that particular page so there are the first thing that I need that I will be writing is in G filter widget - Rho dot conditions remember it says it's s should be there - Rho dot ng - scope and inside this pointed events none okay I'm saving it just I'll reload this page reloading so yeah I think so yeah so now if you just click you won't be able to edit this you cannot edit this anyway or and you cannot just add or or and condition as well so if you want to exclude this or and and condition okay you can just add one more thing here dot BTN PT and default dot BTN and conditions because I'm just excluding and you can no use or as well conditions condition dot add conditions - Rho dot SN filter - tooltip you just make this Auto just mean this autumn and just save it and here if you see now I can do add condition but I won't be able to do or but in the next row I can add anything so this is the add thing if you want you can give four or as well in the same way so you cannot change this condition anyway even if you want to exclude from the filter you won't be able to exclude you cannot do anything with the filter so this is the this was my main motive go ahead do try with or as well and wait for my next video thank you thanks for watching

View original source

https://www.youtube.com/watch?v=8QiWkRMs6rY