
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 08:32 AM
Hello,
I am creating multiple catalog items which all use a shared variable set. I am looking for a way to set a Reference Qualifier Condition via a Catalog Client Script. Is this possible and if so how do I code it?
Thank you,
Joe
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 09:12 AM
Hey,
sorry, my bad - add after line 17 one more "}" - the entire method is not actually enclosed hence we get this error.
Joro
P.S. Sorry for the delay - my actual email is not the one pointed in my account so I dont get notifications (and I cant change it sadly) 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2020 01:59 AM
Hi Joro,
I don not actually see literal example in my code above.
Probably, i mislead you by only pasting one function form actual code.
Please let me know if i missing something.
Here I am using same approach as you mentioned in your answer - a common Script Include class:
/*jshint esnext: true */
var CIQualifier = Class.create();
CIQualifier.prototype = {
....
//methodPerCatalogItems
...
type: 'CIQualifier'
};
CIQualifier.filterForRequest = function(requestId, currentObj) {
var instance = new CIQualifier(currentObj), filter = "";
var configurationVerification = "1fc0c8191360e70076dcb3776144b032",
zoning = 'cc35c6133777b100b94d27d2b3990ea6',
move = '2a4526d30f1331001820e388b1050e0b',
....;
switch(requestId.toString()){
case configurationVerification:
filter = instance.configurationVerificationCollector();
break;
case zoning:
filter = instance.zoneEquipQualifier();
break;
.........
return filter;
};
entire g_form is not needed so we can pass the actual object of interest as param to the method
That is true, but if you have often requirements change
I prefer all my asset qualifiers looks as
javascript:CIQualifier.filterForRequest(current.cat_item, current);
and fully have logic moved into CIQualifier.
This give no redundant modifications of variable record + all qualifier changes are store and review centralized.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2024 08:00 PM
this article worked for me:
How to modify Reference Qualifiers with Catalog Client Scripts – ServiceNow – ServiceNow Think (word...
and this is the onChange client script: