The Now Platform® Washington DC release is live. Watch now!
‎10-04-2016 07:20 AM
Hi All
I have a lookup select box and I want to write a reference qualifier which will populate the data based on data saved to requested For field.
I had earlier set this up as assigned_to =javascript:gs.getUserID();
But this just fetched record for that user. But since we can change the value of Reqested for, hw should I change the ref qual to get it work???
Solved! Go to Solution.
‎10-04-2016 08:31 AM
That is incorrect. The line ref_qual_elements=.... goes in the variable attributes and the javascript one goes in the reference qual section
ref_qual_elements=Requested_For ---->This goes in the variable attributes
javascript:'assigned_to='+current.variables.Requested_For ----->This goes in the reference qual section
‎10-04-2016 07:24 AM
Hi,
It sounds like you are confusing default values with reference qualifiers. A reference qualifier returns a "where clause" to the query. E.g. if you want only active users to show up in your field that reference sys_user, the reference qualifier is 'active=true' It is ALWAYS a query filter.
If you want it to be variable based on another field, then you need to construct that query filter using the other field.
For example: javascript:'location=' + current.requested_for.location
If it gets more advanced then that, I usually use a function my own script include and call it (known as an advanced reference qualifier.)
http://wiki.servicenow.com/index.php?title=Reference_Qualifiers
‎10-04-2016 07:40 AM
Hi Chuck,
I had the lookup select box on Asset table, to get the list of assets assigned to that person.
So,i did put req qualifier there as
ref_qual_elements=<Requested_For>
javascript:'assigned_to='+current.Requested_For
‎10-04-2016 07:30 AM
In order to write reference qualifier on lookup select box, you need to add this to the attributes of he variable ref_qual_elements=<variable name based on which you want to filter>. Once you do that you write ref qual, like javascript:......
‎10-04-2016 07:43 AM
Use this
ref_qual_elements=Requested_For
javascript:'assigned_to='+current.variables.Requested_For