Override reference qualifier

traviswarren
Kilo Expert

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.

13 REPLIES 13

TJW2
Mega Guru

Not sure exactly what you are asking here. To create an Advanced Reference qualifier you don't need the Client Script.
On your Dictionary Override for this table add the call to your function:
javascript:CIClassfunction();

Then in your script include define the function with the reference qualifier that you want:

function CIClassfunction(){

if (current.u_ci_class == 'cmdb_ci_CI_Not_Found') {
return; // this will return all CI's
} else {
return 'sys_class_name = ?????'; // this will return only the CI in the input class ???? = class name
}



First, I have an override reference qualifier set. I also, have a reference qualifier. There is a dictionary override set to 'True' so the override reference qualifier is being used. For one condition I want to unchecked the override reference qualifier from 'True' to 'False'; the reason why I have a onChange Client Script. The onChange Client Script checks when a user changes the CI Class. If the CI Class = None, I want override reference qualifier to be 'False'. if not, it can stay 'True' and use the override reference qualifier I have set.

Does this explain my functionality any better/what I'm attempting to achieve?


Instead of turning your dictionary override off in a Client Script (don't think this will work). Combine the 2 Ref Quals into one function which returns the correct Ref Qual. Call this new function in your Dictionary Override for the table.


From my code I provided before I am not turning my dictionary override off in a Client Script. From within the Client Script I am calling a function that should change the override ref qual from True to False.

If I go your route, how would I check for when the CI Class changes? Seems like there is no way to continually check for when the the CI Class field changes when looking at the sc_req_item; reason for having the onChange Client Script.