How can I get the display value from oldValue in a client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 11:41 AM
I have a requirement to store the old display value of a reference field in a string field. I'm using an onChange client script, but I can't figure out how to get the display value from oldValue. Does anyone know how I can accomplish this? What I have written returns the sys_id, I need the display value.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 11:47 AM
have you tried oldValue.getDisplayValue() ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 03:18 PM
getDisplayValue() isn't available on a client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 11:48 AM
As the great Ashutosh replied here:
1) Why you want to do this using script. Just add the field in activity log same as state field using funnel icon. Which will show you value transition from old to new.
2) You have to write a script include and pass the oldValue sys_id there to get name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2021 12:04 PM
Yup, Script Include is the only way.