Default value for a reference field on UI page

Swetha M
Mega Guru

How to set a particular caller name as default value in Caller field(reference) on an incident form UI page.

25 REPLIES 25

@Ankur Bawiskar ,

 

When my UI page (incident) is loading, a particular user has to be set as default and should get populated in caller_id field.

 

@Swetha M 

when is the UI page loading?

how are you triggering it?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

This is for the Security Analyst workspace and they have a button "CREATE INCIDENT" and when they click on that the page loads .

@Swetha M 

Did you try methods suggested by other members?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ankur Bawiskar ,

 

1. When changing the default value in dictionary, it would obviously reflect in other incident forms throughout, right?? 

 

 

2.When I tried using <g:ui_reference name="caller_id" table="sys_user" value='sys_id of user' displayvalue="${gs.getUser().getUserByID('sys_id of user').getDisplayName()}" />, the form loads and the caller field is not populated( but the "eye" icon displays the user record). On form submission, the caller field is empty.

 

 

3. document.getElementById("caller_id").value = "sys_id of user "; doesn't work as well