- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017 09:48 AM
Hi,
I want user to choose a user in Ui page page in the reference field and want that value to be a part of another reference field query
<g:ui_reference name="user" id="user" table="sys_user" />
<g:ui_reference name="incident" id="incident" table="incident" query="caller_id=${value of first reference field}"/>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017 10:19 AM
Hi Ratish,
I assume you want following this:
Based on first ui_reference selection apply query on second ui_reference and restrict records.
I have provided solution to this in following links.
How to make assigned_to field dependent on assignment group on a UI page
Reference field dependency on UI Page
Refer the same and you should be able to achieve that.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
07-03-2017 10:19 AM
Hi Ratish,
I assume you want following this:
Based on first ui_reference selection apply query on second ui_reference and restrict records.
I have provided solution to this in following links.
How to make assigned_to field dependent on assignment group on a UI page
Reference field dependency on UI Page
Refer the same and you should be able to achieve that.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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
07-03-2017 10:20 AM
Hi Ratish,
you can use a client script to populate the second field with the sys_id of the first field. You can use the id field that you defined to get the value and populate it accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017 11:05 AM
Thanks Ankur,
var UserLookUp = gel('lookup.locationRecords');
UserLookUp.setAttribute('onclick',"mousePositionSave(event); reflistOpen( 'locationRecords', 'not', 'cmn_location', '', 'false','QUERY:active=true', 'sys_idIN" + locationArray+ "', '')");
with some changes did the trick for me. Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2017 11:59 PM
Hi Ratish,
Great that it worked. It would be nice if you endorse the content. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader