Set Reference Qualifier in Service Catalog item via onchange script?

jamesmcwhinney
Giga Guru

Within a service catalog item, within a variable's onchange script, is there a way to set the reference qualifier of another variable within the same catalog item?

Thanks!

- James

1 ACCEPTED SOLUTION

Try


javascript:new TravelPlanReferenceQualifier().setTheQualifier(current.variables.selected_destinations.toString())



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

14 REPLIES 14

Espinomen
Tera Contributor

You can use an Advance Reference Qualifier to get the value of the variable and a Script include to get the query you need



the code you insert is   =   javascript: new scriptinclude().Function();


Subhajit1
Giga Guru

Hi James,


You can give a try using Dynamic Reference Qualifiers:-


Reference Qualifiers - ServiceNow Wiki


SanjivMeher
Kilo Patron
Kilo Patron

Can you give an example of what you are trying to do?



Please mark this response as correct or helpful if it assisted you with your question.

jamesmcwhinney
Giga Guru

Hi Guys,



Thanks for your responses.   Much appreciated, however I think I still need some assistance.



Here is my use case:



1. End user opens up catalog item "Mobile Travel Plan" with multiple checkboxes and a drop down.


2. User clicks a few of the checkboxes "Will you be traveling to Africa?: YES", which causes the reference field "Select a Plan" to be cleared out.


3. User clicks the "Select a Plan" reference field and sees only the travel plans which relate to africa (There is a column in the reference table containing the countries that plan applies to "AF,CS,CA,US,etc etc"



If I understand correctly, is the idea that I should create a script include that accepts the checkbox values as variables, and then set the advanced reference qualifier to call that function and pass the checkbox values as parameters?


(My assumption is that I wont be able to access the form values directly from code within the script include)



Thanks again,


- James