- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 03:39 AM
ITIL users should be able to search for users from all locations in "on behalf of" field, otherwise users specific to that location should be filtered in record producer/service portal.
So, for the field, I used the advance conditions, in the reference qualifier like this, but it is not working.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 06:18 AM
javascript: (gs.hasRole('itil') ? 'active=true' : 'location=' + gs.getUser().getLocation());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 03:43 AM
Its better to use a script include and put your condition and call it in the ref qual.
Basically you query should be like
javascript:"location=" +gs.getUser().getLocation()^EQ;
Check this
https://www.servicenowguru.com/scripting/script-includes-scripting/advanced-reference-qualifier-script-include/
https://docs.servicenow.com/bundle/paris-platform-administration/page/script/server-scripting/concept/c_ReferenceQualifiers.html
https://community.servicenow.com/community?id=community_question&sys_id=6740c7a1db98dbc01dcaf3231f9619b7
Regards
Pranav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 03:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2020 03:58 AM
Hi,
please update the ref qualifier as below
javascript: var query = ''; if(!gs.hasRole('itil')) query = 'location=' + gs.getUser().getLocation(); 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
10-05-2020 04:52 AM
This should work:
javascript: (gs.hasRole('itil') ? '' : 'location=' + gs.getUser().getLocation());