disable choice list options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2015 12:46 PM
Is there a way to disable choice list options based off a query. I have seen this Removing or Disabling Choice List Options - ServiceNow Guru
but what if my 'choice list' is actually a reference field and based on a previous user answer I wan to be able to remove certain choices from the reference.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2015 01:05 PM
For a reference field you should be able to use a reference qualifier to do that.
Reference Qualifiers - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2015 02:39 PM
I guess its a little more complicated than that. What I am trying to do is have a reference qualifier that when a user is selected goes out to the user table and looks to see if any one of 4 conditions are meet (Boolean fields) and if they are an a record producer only show certain choices. So I am thinking that I need to build a script include to query the user table and if those conditions are meet show them specific options..?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2015 03:35 PM
Yep you should be able to use an advanced reference qualifier with a script include to evaluate more complex conditions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2015 09:40 AM
I am not sure if I am on the right track here. I am trying to search the user table and if some values are true I need to look up in a new table where the u_c_level value is true and only return those records. I am not sure how to look up the records and only return the ones needed.. Glide query to the table ? and how would i return the result to the list.
var GetUserAttributeAjax = Class.create();
GetUserAttributeAjax.prototype = {
initialize: function(GetUserAttributeAjax) {
var usr=current.variables.usrName;
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name',usr);
gr.query();
if (usr.u_ceo == true || usr.u_cfo== true ){
//return records to choice list from u_group table where u_c_level = true
}
else { //return other records where u_c_level false
}
},