Dynamic Reference Qualifier not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2017 11:00 AM
In trying to clean up how users create change requests for specific CIs we want the reference field Configuration Item to be filtered based on the sys_class_name matching to the option selected in the Subcategory. I'm trying to do this through a Dynamic Reference Qualifier but it doesn't appear to be filtering the filter. The field Does appear to filter correctly when I don't use a script and just put the javascript in the Script section of the Dynamic Filter. Can anyone point out what is not configured properly and is preventing it from loading correctly?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2017 11:04 AM
For whatever reason, this doesn't feel like a use case for a dynamic reference qualifier. Have you tried just using an advanced reference qualifier with the Ref Qual string:
javascript:setCIFilter(current);
and put your setCIFilter() in a (classless) script include?
Seems like one less level of indirection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2017 11:45 AM
I've tried using just the function name defined in the script but nothing happens. I also tried changing it to an object class definition and running it with the same 'Advanced' filter setup. If it won't work like this, is this something I could setup to work by using an action like g_form.getElement('u_configuration_item'); attached to an on-change client script for u_subcategory to modify the filter defined on the page loaded for the user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2017 12:02 PM
You need to call the advanced reference qualifier as chuck said, It should like, javascript: new scriptIncludeName().functionName();
But in your screen shot , you created one client script and called in the reference qualifier condition, it was wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2017 12:10 PM
Made the recommended changes and it had no change:
var setCIFilter =Class.create();
setCIFilter.prototype={
initialize :function(){},
setFilter :function(){
//function setCIFilter(current) {
if (current.u_subcategory == "-- None --") {
return "Application";
} else {
gs.log(current.u_subcategory);
return 'sys_class_name=' + current.u_subcategory;
}
},
type :'setCIFilter'};