- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:32 AM
I have a reference field on my form, that currently references our user table. However, I have a role in my scoped app, and I only want that field to reference users who have the specific role. I cannot use getRoledUsers() from the OOTB business rules, as this reference field is within a scoped app. (As far as I understand, the OOTB can only be called in the global scope)
If anyone could help me out, that would be great. I don't have any code, but a generic answer of how I would go about refining my reference qualifier based on a role, whether its through a scoped business rule, script include, or just javascript in an advanced qualifier, would be of much help.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:48 AM
Hi,
you can try to use this
javascript:'roles=yourRoleName';
OR
you can also use script include and get all users with that role by querying sys_user_has_role table; store the user sysIds in array and then return that array
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2022 09:48 AM
Hi,
you can try to use this
javascript:'roles=yourRoleName';
OR
you can also use script include and get all users with that role by querying sys_user_has_role table; store the user sysIds in array and then return that array
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader