- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 10:38 PM
Hello Everyone,
We have a requirement where i need to hide some fields from Customized table since we do not Active checkbox option i think i need to write some script to hide the fields.
Can anyone please help me out how to achieve this ?
List of field what i have is:
Network-ABA
Network-Operations
Network-Infra-Su
Network-Infra-Mu
Network-Infra-Ku
Network-Infra-Zoa
Network-Software
Network-Hardware
Network-Admin
I want to hide the fields which starts from Network-Infra:
Network-Infra-Su
Network-Infra-Mu
Network-Infra-Ku
Network-Infra-Zoa
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 12:55 AM
Please create Before Query Business Rule with below code, it should work.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.addQuery("<FIELD NAME WHICH HOLD THE VALUE>",'NOT LIKE' ,'%Network-Infra%');
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 10:45 PM
Use UI policy
http://wiki.servicenow.com/index.php?title=Creating_a_UI_Policy#gsc.tab=0
Or client script
http://wiki.servicenow.com/index.php?title=GlideForm_(g_form)#gsc.tab=0
to hide fields

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 10:45 PM
Hi Shaik,
You can use g_form.setDisplay() property to hide the field in onLoad() client script. Something like below should help.
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setDisplay('field_name_of_Network-Infra-Su', false);
g_form.setDisplay('field_name_of_Network-Infra-Mu', false);
g_form.setDisplay('field_name_of_Network-Infra-Ku', false);
g_form.setDisplay('field_name_of_Network-Infra-Zoa', false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 11:03 PM
Shishir,
Thanks for the reply, just a small doubt i explained wrong these are the list of records in a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2017 11:09 PM
Hi Shaik,
If you want to hide a list of records, you may need to write a before query business rule.
Here is an example:
Example script: default before-query business rule
You may want to customize it add logic that you want.
Hope this helps!
Thanks,
Neena