Readonly 'List' field displays undefined when set by script


Description

When a 'List' (glide_list) field set as Read only at dictionary level and set via a script, it displays 'undefined' in form layout.
This issue is only visual, actual value is getting saved into the field

Steps to Reproduce

1. Create a readonly List field. i.e. Set 'work_notes_list' field of task table as readonly
<instancename>/sys_dictionary.do?sys_id=2d6d1d7c74e0330078509adcc48c874d

2. Create an onLoad client script on Incident table
Name: <name>
Table: Incident
Type: onLoad
Script:
function onLoad() {
g_form.setValue('work_notes_list', '62826bf03710200044e0bfc8bcbe5df1'); //Abel Tuter's sys_id
}

3. Go to any Incident record and check 'Work notes list' field

Actual behavior: Field displays 'undefined'
Expected behavior: Field displays 'Abel Tuter'

Workaround

There are two possible workarounds;

1) Instead of using "g_form.setValue(<field>, <sys_id(s)>);" format, please use "g_form.setValue(<field>, <sys_id(s)>, <label(s)>);" format. 

2) Set the field as readonly via a UI Policy instead of setting it at dictionary level


Related Problem: PRB1350605