Only need members part of particular group to be visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2023 10:55 PM
Hi All,
I have a requirement to create a field which is of type reference, and it is referring to sys_user table but i have a requirement that the users which are part of one of the particular groups should only be visible. How to do this please do share pointers and script if required to achieve this.
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 12:07 AM - edited ‎08-07-2023 12:08 AM
Hello,
Reference fields can have an advanced qualifier where you can define a script. Here you can call a script include of your choosing.
You script include must return a list of sys_ids of the users you need. Query the table "sys_user_grmember" table for the group in question and have the script return a comma seperated list of all user sys_ids. Then call that script include and add
javascript:"sys_idIN" + new myScriptInclude().my_refqual()
to the reference qualifier of the user reference field.
Hope this helps.
Regards
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 12:17 AM
You can call this by using reference qualifier. Go to the field dictionary, select advanced reference qualifier and use below line
javascript: new AssignedGroup().SetAssigned();
AssignedGroup = It is Script include name
SetAssigned = It is function
***********************************************************************************************************
Below code will use in SI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 01:46 AM
Hi @Kalyani Jangam1 ,
I tried this script, but it is not working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 02:45 AM
1)Please confirm your Script include is not client callable.
2) Please confirm your reference qualifier like this
you can use log message in script include for checking your code.
Please check and let me know if it helpful or not.