how to make reference field readonly in UI page

fgh1
Tera Contributor

I want to make reference field readonly on popup window using UI page. earlier I added that but still it is replacing with other value after making it readonly

 

fgh1_0-1703753720607.png

still it is giving me to change incident number after making readonly.

 

code in ui page :

html:

<label for="incident" id="inputLabel3"  class="makeMandetory" style="font-size: 20px;">Current Incident Record</label><br/>
<g:ui_reference name="incident" id="incident"  
table="incident" value="${jvar_pref}" displayValue="${jvar_pref2}"/><br/><br/>

client script:

var ro = gel('sys_display.incident');
ro.readOnly = true;
 
Thanks in advance!!
 
7 REPLIES 7

@fgh1 

 

Ohh. Can u check below link see if that helps similar issue there as well

 

https://www.servicenow.com/community/developer-forum/reference-field-read-only-issue-in-ui-page/m-p/...

 

Thanks,

Danish

 

for now it is working for me. If there is no any other way then it works for me.

Thanks

@fgh1 

 

Glad to hear.