
- 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-28-2020 09:01 AM
So,
If you select from a field (as an example) "Company" Gapple, only users from this company to be selectable ?
If so use this approach :
https://community.servicenow.com/community?id=community_question&sys_id=fa338be1dbd8dbc01dcaf3231f961923
Will that do the trick?
Joro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 09:53 AM
Thanks for the help Joro.
If I create a new script include in System UI > Script Include called "CompanyReferenceQualifier" What would the script include code look like?
Also, what would the reference qualifier look like? I would be using a reference variable in the variable set called "employee_name"_ referencing the table sys_user > company

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 10:13 AM
Hi Joe,
give me like 10 mins and will post here the initial version. Then we have to refine it a bit till the working thing is done 🙂
Joro

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 11:15 AM
Thanks for the help, Joro. I appreciate and look forward to seeing the initial version.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 11:47 AM
Sorry for being a bit late - got led astray coz of some anooying bugs popping like Covid-19 😛 So, let go then 🙂
var CompanyReferenceQualifier= Class.create();
CompanyReferenceQualifier.prototype = {
initialize: function() {
},
getAllowedUsers: function(user){
var grUser = new GlideRecord('sys_user');
grUser.addQuery('user_name', user);
gr.User.query();
if(grUser.next()){
return "sys_idIN" + grUser.company + "";
},
type: 'CompanyReferenceQualifier'
};
Then we call this from the cs var set - in the advanced section add " javascript: new CompanyReferenceQualifier().getAllowedUsers(current.NAME OF THE CAT VAR)
Can you test it out and see whats going to blow up so we can fix it 😄