- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2020 11:38 PM
Hi,
I have a field Requested on Behalf on a catalog item which is a reference field to the sys_user table. By default, we will be able to see only active users in the Requested field, But I also want to see inactive users in the requested field.
1. One solution for this is to give the user_admin role to a particular user(not the best solution though) and we are not allowed to modify the OOTB business rule as well.
I heard that some business rule is locking the user session to only show active records.. Don't know much abt that.
So how we achieve this? Any help would be massively appreciated..
Thanks!!
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2020 03:32 AM
Thank you ankur and jaspal. I have written and article on this https://community.servicenow.com/community?id=community_article&sys_id=e2f2878bdbd4ec1011762183ca961... . This solves my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 10:58 PM
Hi Harish,
please check the url looks something like this when you open it from the lookup icon besides the variable
it contains the variable information -> i.e. sys_id sysparm_target=IO:677f33d54ffda700fc11fa218110c710
highlighted in bold is the variable sys_id from the table "item_option_new"
So you can use this to restrict the BR not to run for this variable
Note: you use the sys_id of your variable from the "item_option_new" table
Updated Script:
var url = gs.action.getGlideURI().toString();
var index = url.toString().indexOf('sysparm_target=IO:677f33d54ffda700fc11fa218110c710');
if (index == -1) {
current.addActiveQuery();
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
06-04-2020 11:40 PM
Hi Ankur,
I have followed the same steps which you have mentioned.
I have created a script include which contains the above script and calling it in the onchange client script on the catalog item. But It doesn't seem to be working or maybe I have done something wrong.
Can u please help.
Script Include:
OnChange client Script on Catalog:
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 11:51 PM
Hi Harish,
you need to update the out of the box "user query" business rule
no other change required; no onchange; no script include
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
06-05-2020 04:49 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2020 04:58 AM
Hi Hari,
When you open the Catalog item on Portal can you kindly help with the URL as well once.