Hide a reference variable option based on Users department
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 06:46 AM
Good afternoon,
I have a requirement to hide an option (in a reference variable), if the users department starts with BT.
I have created this script Include and On Load script, but I am not sure how to progress with hiding the value now.
The variable's name is 'u_application', it is referencing to 'u_emergency_incident' table, and the option I want to hide is named 'IT'.
Script Include

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 08:58 AM - edited ‎11-21-2024 08:59 AM
Replace the line
alert("The string starts with 'BT'");
with
g_form.removeOption('yourField', 'choiceValue')
here is the screenshot of the docs for this method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 03:36 PM
Hi Zach, thank you for your response, unfortunately the removeOption is no longer supported, as per this KB : removeOption does not worth through client script access to variable fields on task records - Known ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 09:08 AM
You're on the right track but I might suggest tackling it a different way. You can still use your Script Include but i'd then add it as an Advanced Reference Qualifier on the field you're looking to filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 03:37 PM
Hi, would you please share an example of the Advanced Reference Qualifier? Thank you