How to replace the ui_reference query in UI Page with the client side function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 07:31 AM
II have a requirement in the Risk Assessment where the Reassign button opens the “reassign_coordinator” UI Page with an “Assessor” field. I want to modify the reference qualifier query for the Assessor field to only include members belonging to the assessor group. To achieve this, I created a function in a client script that calls a script include function to retrieve the assessor group members. However, I am unable to replace the current query with my function.
Query which I want to replace with function - query="active=true^roles=sn_grc_reg_change.user^EQ"
<g:ui_reference name="coordinator" id="coordinator_name" table="sys_user" field="name" query="active=true^roles=sn_grc_reg_change.user^EQ" onchange="checkMandatoryFields(this)"/>
I want to replace the query with my function. How should I define it?
Any help is appreciated.
Thanks,
Anmol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 08:16 AM
check this link where I shared solution on how to set the filter when UI page loads in g:ui_reference, please see that and enhance as per your requirement
Store value in reference field of ui page using client script
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 09:11 AM
Hi Ankur, thanks for looking into this, I need to populate the members only from the assessor_group field only present on the assessment record, how should I query to get the members only present to group at that time?