- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-11-2022 03:27 AM
Hi Community,
I'm trying to fetch the Name value on User record to a field in UI page calling on same record(please find the attached screenshot) can I get some help in prepopulating the Name into the User name(see screenshot) using any script in UI page.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-11-2022 03:40 AM
Hi,
You will have to pass sys_id not name as your field on UI page is reference field.
In UI action, you will have pass it by below method.
var dialog = new GlideDialogWindow("test_dialog"); //Render the dialog containing the UI Page 'task_comments_dialog'
dialog.setSize(1250,500);
dialog.setTitle("Page Title"); //Set the dialog title
dialog.setPreference("user_sys_id", g_form.getUniqueValue());
use in the dialog
dialog.render();
Access and set reference filed in UI page as below,
<g:ui_reference name="user" id="user" table="sys_user" value="${RP.getParameterValue('user_sys_id')}" completer="AJAXTableCompleter"/>
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-14-2022 06:58 AM
How was this use case resolved finally? Any update?