Remove the reference qualifier condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 02:21 AM - edited ‎07-03-2023 02:22 AM
Hallo,
I am trying to create a catalog client script. I have a checkbox field called 'user_not_visible' and a reference field called 'requested_for'. The reference field has a reference qualifier condition based on a field called 'Territory' to filter users based on their territory. When the checkbox is checked, I want to remove the reference qualifier condition and show all users in the reference field. However, the current script I have tried is not working as expected.
See images please
---------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2023 11:36 PM - edited ‎07-04-2023 11:40 PM
Hi @Simo Shaf ,
Try this, it'll work.
var requestForCheckbox = g_form.getBooleanValue('user_not_visible')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 03:40 AM
requested_for is of what type? reference or list collector?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 03:46 AM - edited ‎07-03-2023 03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 03:54 AM
then don't use onChange client script
Just use advanced ref qualifier on that reference variable
Ensure you give correct sysId of that territory you have selected
javascript: var query = ''; if(current.variables.user_not_visible.toString() == 'false') query = 'territoryField=sysId'; query;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 04:31 AM
Hi @Ankur Bawiskar
Thanks! But it doesn't work.