set reference qualifier through script for Lookup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2014 05:34 AM
I am working on Eureka and looking help to set reference qualifier through script for Lookup Select box catalog variable. I have two variables:
- Application - Select box
- 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 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 12:13 AM
Please refer below link to set filter for list collector through client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 01:12 AM
I have a reference qualifier on a catalog item that is doing that now on change of a dependent variable as well, so I'm not sure why mine is working and yours isnt, you can use current like this....
javascript:getConfigGroups()
function getConfigGroups(){
var app = current.variables.app; //this works on change for me i.e.: if I change the app, it brings a different set of groups when I lookup
var gp = ' ';
var grp = new GlideRecord('cmdb_ci_appl');
if(grp.get(app)){
if(!grp.u_configuration_manager_groups.nil()){
var cfggroups = grp.u_configuration_manager_groups;
return 'sys_idIN' + cfggroups;
}
}
else {
return 'active=true^u_configuration=true';
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 01:37 AM
I believe you are using reference qualifier on the variable of type "Reference". It is working for me in reference fields but not on variable type "lookup select box". I think because select box values are populated when the form is loaded itself, but reference field will query the options from server each time when we click on look up icon. Please correct me If I am wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 01:43 AM
yes you are correct, select box will only populate onload and won't respond to changes.
I'm sure I've seen a client script before to force the choice list to refresh though, i'll have a look now for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2014 01:48 AM
This this, we are doing this on a field called u_service in a knowledge article but it may well work on catalog variables as well:
updateChoiceList_u_service() ;
swap u_service for the internal name of your variable
If it doesn't work then you might have to settle for a reference field instead of a choice list?