Slava Savitsky
Giga Sage

According to the documentation, g_form.getDisplayValue('your_field_name') only works in Service Portal. For the Core UI, you need to use this instead:

 

g_form.getDisplayBox('your_field_name').value

 

 

To combine the code for both UIs in one script, you can use the following approach:

var fieldName = 'my_field_name';
var fieldValue = '';

if (window == null) {
    // Service Portal UI
    fieldValue = g_form.getDisplayValue(fieldName);
} else {
    // Core UI
    fieldValue = g_form.getDisplayBox(fieldName).value;
}