Filter a group reference field to only get the groups of a selected user

Emmanuelck
Tera Guru

Hello Everyone!

 

I have a task that requires me to filter a group reference field to only get the groups of a selected user. I believe I tried every possible solution, and got close many times. 

 

I user the advance reference qualifier of the group field, as well as a client callable script include. 

Here is my script include:

script include.png

I do not think there is any issues with it, I'll explain why later.

Here is the Reference qualifier of the group field:

(CODE: javascript:new u_getUserGroups().getGroups(g_form.getValue('requested_for')) )

ref qual 2.png

 

The result is unfortunately an Unfiltered list:

results2.png

 

I think the issue is coming from the Reference qualifier, because if I use a hard coded sys_is string (for user andrew.jackson), I do get the right filter:

Here is the Reference qualifier with hard coded string:

ref qual.png

And here is the result:

results1.png

 

Would anyone know why it doesnt work with g_form.getValue?

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Asif Khan M
Giga Guru

Hi,

Can you try using javascript:new u_getUserGroups().getGroups(current.variables.requested_for) ?

View solution in original post

2 REPLIES 2

Asif Khan M
Giga Guru

Hi,

Can you try using javascript:new u_getUserGroups().getGroups(current.variables.requested_for) ?

That was it! Thanks a lot Asif.