Reference Qualifere is not working from the catalog variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 05:18 AM
Hello Community,
I'm facing an issue with the reference qualifier of the catalog variable.
Requirement-
For that, we have two variables: -
1. Former Associate's Name [associate_name] type - Reference (sys_user)
2. Manager's Name [contact_name] type - Reference (sys_user)
I want to select only those users in the Former Associate's Name variable whose manager is selected from the Manager's Name variable.
Development:
We have called the script include from the reference qualifier of the Former Associate's Name catalog variable.
javascript:new global.getManagerDirectReport().getManagers(current.variables.contact_name);
Script Inlcude:
Note- We don't have any ACL on the Script inlcude.
var getManagerDirectReport = Class.create();
getManagerDirectReport.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getManagers: function(manager) {
var mgr_sys_ids = [];
var userAgg = new GlideRecord('sys_user');
userAgg.addQuery('manager', manager); // Get users who have a manager
userAgg.query();
while (userAgg.next()) {
mgr_sys_ids.push(userAgg.getUniqueValue()); // Get the manager sys_id
}
return 'sys_idIN' + mgr_sys_ids.join(',');
},
type: 'getManagerDirectReport'
});
This is working as expected for some users, which means when I select manager so only those user shows in Former Associate's Name, whoever the manager is selected.
But when I select a different manager so for the Former Associate's Name variable shows the searching only.
Previously, I thought this was a role issue with the selected manager but when I selected a different manager with the same user role so this was working fine for the selected manager.
Could anyone please help me to resolve this issue? Why is this functionality working fine for some user's but not for some user's?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2025 05:26 AM
Hi @mihirlimje867 ,
Make the former associate field non mandatory and hidden by default. And whenever a value selected in the manager field, make this field mandatory and visible.
Then it works.
Kindly mark the answer Correct and Helpful if it helps to resolve your issue.