I want to create which is Department is NOT Network how to write a script for the same
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 03:41 AM
Hi,
I want to create which is Department is NOT Network how to write a script for the same.
Please help me out with the script so that I don't want to show some of the items Department is Not Network.
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 04:59 AM
so handle it via script
// check if logged in user does not belong to Network department
var grSysUser = new GlideRecord('sys_user');
grSysUser.addQuery('sys_id', user_id);
grSysUser.addEncodedQuery("department.name!=Network");
grSysUser.query();
answer = grSysUser.hasNext();
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2023 05:04 PM
Hi Ankur,
It is not working as per expectation.
Thanks,