Not getting values in Reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2022 11:52 PM
Hi,
I have created 1 reference type variable and referenced it to table 'Contact'.
I want that users same as logged in users account should only be visible in the dropdown.
So I used the advanced qualifier and wrote the qual as '
javascript: 'active=true^account='+gs.getUser().getCompanyID();
but in dropdown I am only getting the logged in user. Where is it going wrong. Please advice
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 01:02 AM
Hi,
The code seems correct.
Can you try logging out of session and login again and then try?
Related posts:
https://community.servicenow.com/community?id=community_question&sys_id=fb58025fdb553c50981a0b55ca96...
If it still doesn't work, then check the field account on table once.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 01:02 AM
Hi Rachael,
Over Contact table, did you try same? Are you getting results?
In Ref Qual you are providing company id hoping that value is not blank if yes set some random company value and the account field used is a reference to the company table if not please check which field it should be used for further dotwalk.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks & Regards,
Viraj Hudlikar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 01:04 AM
I've tested this on my instance and found that gs.getUser().getCompanyID() in not returning company id.
Would recommend write a script include to return company id and use that in reference qualifier.
var UserInfo = Class.create();
UserInfo.prototype = {
initialize: function() {},
getCompanyID: function() {
var grUser = new GlideRecord('sys_user');
if (grUser.get(gs.getUserID())) {
return grUser.company;
}
},
type: 'UserInfo'
};
Reference Qualitifier
javascript: new UserInfo().getCompanyID();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2022 01:06 AM
I've tested getCompanyID() before and it was working. It may be due to the upgrade. It doesn't seem to be working now.