Using script include to set filters on a reference field dropdown list based on another field choice selection

Aindrila Mondal
Tera Expert

I have a record producer which has 2 variables category and configuration item.category being a select box and configuration item is a reference field referencing to cmdb_ci .I need to filter the configuration item on the form depending on the category selected.I tried using script include to set the filters and call the script include in the advance reference qualifiers .Its not working,its not filtering the configuration list as i want.I don't know even if the category selected is being picked up by the script include or not.

Leaving some screenshots:

find_real_file.png

find_real_file.png

Immediate help is appreciated.thank you!

1 ACCEPTED SOLUTION

Sourav16
Kilo Guru

Hi,

You need to pass the current object to the script include like this :-

javascript:new PopulateCIbasedonCategory().u_getCIRefQual(current)

 

And in your script include use this current.variables to access the variable value like this :-

current.variables.category.getDisplayValue(); // instead of current.category.getDisplayValue()

 

Thanks

Sourav

View solution in original post

2 REPLIES 2

Sourav16
Kilo Guru

Hi,

You need to pass the current object to the script include like this :-

javascript:new PopulateCIbasedonCategory().u_getCIRefQual(current)

 

And in your script include use this current.variables to access the variable value like this :-

current.variables.category.getDisplayValue(); // instead of current.category.getDisplayValue()

 

Thanks

Sourav

Aindrila Mondal
Tera Expert

Thanks Sourav.It worked perfectly.thanks