set reference qualifier through script for Lookup

sncrnd
Kilo Contributor

I am working on Eureka and looking help to set reference qualifier through script for Lookup Select box catalog variable. I have two variables:

  1. Application   - Select box
  2. Operation — Lookup select box

 

I put reference qual = "u_application_unit=" + current.variables.application for variable "Operation".

 

But this works only on load not on change of variable Application   variable. reference current.variables in the reference qualifier and have the field refresh when another variable changes

Can anyone help me how to do this.

 

Thanks

Chandan !

30 REPLIES 30

marcguy
ServiceNow Employee
ServiceNow Employee

I would put this into a script include and call that in the Ref Qual, you will be able to evaluate the currently selected app that way:




reference qualifier: javascript:returnOperations()



script include:


name: returnOperations();



var answer = ''; //use to return blank if app is not currently having a value


var app = current.variables.application; //query the variable application


if (!app.nil()){ //if app is not empty


answer = 'u_application_unit='+app; //include the query


}


return answer; //return the query


sncrnd
Kilo Contributor

Hi Mguy,



Thanks for your reply.


When i see your script. you are using current in script include.


1. In script include current   will not work.


2. Script include always work on form load not on change.


If you have any other idea please help my.



Thanks


Chandan


jeeva3
Mega Contributor

Reference qualifiers in look up select box will not work on OnChange. You have to write OnChange catalog client script on Application variable and you can dynamically populate the options for Operation variable by querying the look up table


sncrnd
Kilo Contributor

Thanks Jeeva,


I am doing the same approach right now. But I was thinking can we use g_filter to set filter query in client script for List Collectors. Do you know about this?



Thanks


Chandan