Refrence Qualifier for a field to include users from certain group.

Shree Nag
Tera Expert

Hello,

Appreciate your help in advance.

 

I have a reference qualifier condition to get active users, in a group from a company onto a field in catalog form.

I'm using reference on sys_user table and the Ref script is as below.

 

javascript: 'active=true^company=' + current.variables.company^sys_idIN'+getIDs("3c292940472cfd10f726ba67436d43b5"); function getIDs(grp){var m=GlideUserGroup.getMembers(grp);var ids=''; while (m.next()){ids+= (m.user+',');} return ids;}

 

 

I'm able to pull active users from the company, but issue is the script is not pulling the active users from that certain group.

 

Attached is the screenshot.

 

Please help.

 

-Thanks

1 ACCEPTED SOLUTION

Chaitanya ILCR
Kilo Patron

Hi @Shree Nag ,

Try this out

 

update the ref qual with

javascript & colon;'active=true^company=' + current.variables.company + '^sys_idIN' + getIDs("3c292940472cfd10f726ba67436d43b5");

function getIDs(grp) {
    var m = GlideUserGroup.getMembers(grp);
    var ids = [];
    while (m.next()) {
        ids.push(m.getValue('user'));
    }
    return ids.toString();
}

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

View solution in original post

1 REPLY 1

Chaitanya ILCR
Kilo Patron

Hi @Shree Nag ,

Try this out

 

update the ref qual with

javascript & colon;'active=true^company=' + current.variables.company + '^sys_idIN' + getIDs("3c292940472cfd10f726ba67436d43b5");

function getIDs(grp) {
    var m = GlideUserGroup.getMembers(grp);
    var ids = [];
    while (m.next()) {
        ids.push(m.getValue('user'));
    }
    return ids.toString();
}

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya