- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 12:31 AM
I created a variable set in catalog item. I created a open for field with reference field from User table. If logged in user is manager then he/she can raise the requests for their sub-ordinates as well. How can I achieve this using client script?
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2022 08:20 PM
Hi,
it should be present in the advanced ref qualifier of that variable and not client script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 12:44 AM
Hi,
so if logged in user is manager then you can use this in the advanced ref qualifier
it would show the logged in user and also users who report to that
javascript: var query; var rec = new GlideRecord('sys_user'); if(rec.get('manager', gs.getUserID())) { query = 'sys_id=' + gs.getUserID() + '^ORmanager=' + gs.getUserID()}; query;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 10:22 PM
I am getting below error, when I am writing catalog client script.
Where should I use this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 10:42 PM
error - The object "gs" should not be used in client scripts.
I am getting this error. where Can I write this script in Variable set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2022 08:20 PM
Hi,
it should be present in the advanced ref qualifier of that variable and not client script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader