Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 01:21 AM - edited 08-14-2024 01:27 AM
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;
}
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/