Question on reference qualifier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 08:43 AM
Hi All,
We have one field in change module form 'u_peer_approver', we are using group member as an reference for that field in configuration dictionary. But while using this we are getting multiple users records when we type any user name in the peer approver field but it should show one one record of the respective user which we are typing or searching for. to resolve this we are using Advanced reference qualifier and we are using below code for that but it is not working for us. Could anyone help me on this.
Please find below code which we are using.
var uniqueUsers = new Set();
var searchTerm = current.getDisplayValue('u_peer_approver');
var grUser = new GlideRecord('sys_user');
grUser.addQuery('active', true);
if (searchTerm) {
grUser.addQuery('name', 'CONTAINS', searchTerm);
}
grUser.query();
while (grUser.next()) {
uniqueUsers.add(grUser.sys_id.toString());
}
- if (uniqueUsers.size > 0) {
answer = 'sys_idIN' + Array.from(uniqueUsers).join(',');
} else {
answer = 'sys_idIN';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 08:53 AM
Using the sys_user_grmember table, you are going to see one record for every group that the user is a member of. The reference table for this field should be sys_user, then you can add a qualifier to only show members of the assignment group or whatever if you don't want to see all users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2024 10:23 PM
@Brad Bowman while searching any user name in peer approval field at that time I'm getting same user name with multiple records. but here I should get name in single record, so could you please help me on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2024 04:23 AM
Did you change the Reference table to sys_user as I suggested?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 10:37 PM
@Brad I had tried using the reference user table, and it works, but it is for an old ticket where the peer approval value gets erased. Thats why we were trying this reference qualifier, but even that code is not working.