restrict a record to be selected in reference field if that record is already selected in another
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 01:49 AM
How to restrict a user record to be selected in a reference filed if that record is already selected in the 1st reference field?
Ex:-
There are 2 reference field
Controller 1 and controller 2 >> reference to sys_user table and there is an advanced RQ which will show only the users those are member of "ABC" group.
for example , in "ABC" grp if there are 3 users A,B, and C.
If user "A" is selected already in the "Controller 1" field, then I can't select user "A" in the 2nd filed "Controller 2".
I can only select either user "B" or user "c" in the 2nd reference field.
Search Results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2024 04:09 AM - edited 01-28-2024 05:20 AM
Pass the currently selected user in Controller1 in advanced qualifier of Controller2.
If you are calling a script include to get the members of the 'ABC' group where probably you would have created a function for this. In the same script include, include a similar function but add an additional filter for - user is not the one selected in Controller1
roughly: group=(<sysid of your group>)^user!=(<sys id received from parameter>) as an encoded query
In your Controller2 you can have something like
javascript : new ScriptIncludeName().functionName(<current.Conroller1 backendname>) /OR (current.variables.Controller1 backend name if its in catalog item)---> This will be the value of(sysid) of user selected in Controller1
In the script include function accept this parameter - your function name: function(<value>)
and do your GlideRecord as usual.