Override reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2013 08:32 AM
I am attempting to create an OnChange Client Script that will change the value of the specific Override Reference Qualifier from True to False. The only trouble I have is the syntax to change this value when a specified condition is true. Below I will give you my attempts to access this variable and hopefully someone can lead me in the correct direction.
I believe the one liner should be something like this...
Attempt 1: task.cmdb_ci.sys_dictionary_override.reference_qual_override="false";
Attempt 2: sys_dictionary_override.sc_req_item.cmdb_ci.reference_qual_override = "false";
Attempt 3: sys_dictionary_override.sc_req_item.cmdb_ci.reference_qual_override = 'false';
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2013 09:11 AM
Did you already have something in the attribute field of the variable?. If yes, then it will not override. Remove it from the attribute of hte variable and use a IF ELSE condition in the onChange client script to set the reference qualifier..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2013 09:37 AM
I will attempt to explain myself in more detail with a little background of my scenario.
Currently I have a CI field and a CI Class field. Currently, you can choose a CI Class and the CI reference field will only populate the CI's in the corresponding CI Class. This is because the Dictionary override - override reference qualifier is set to True on the sc_req_item.
At the time, a user can only submit a CI if they know what CI class its in.
I want the user to still have the option to type in a CI without having to know the CI Class.
I wrote a OnChange Client script that checks for when the CI Class is none; tested and functional. What I am looking for is the syntax or a one liner that would change the Override reference qualifier from True to False so a user can type in a CI without knowing the CI class.
I hope this helps us both.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2013 06:19 AM
You can write a custom Dictionary override, by call a function in you override.
Override condition: javascript:getMyCondition();
Then define your function:
function getMyCondition(){
if (current.u_ci_class != ''){
return 'sys_class_name='+current.u_ci_class;
} else {
return '';
}
This is explained in more details under 'Advanced Reference Qualifiers on the WIKI:
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers#Advanced_Reference_Qualifiers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2013 06:29 AM
Thanks for the reply. I was just working on a script include call. Not finished yet but this reply will help me out. I will reply back if everything works out.
Thanks again!