Why getDisplayValue() displaying sys_id instead of value for glide list type field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:37 PM
Hi Community,
I have a glide list type field and I want to copy display value of that field to another field of string type.
I created a before- insert/update Business rule for the same with below code:
current.field1=current.field2.getDisplayValue();
gs.addInfoMessage(current.field1);
The above info message is displaying sys id instead of value.
Please someone help on this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:39 PM
are you in scoped app or global scope?
also the field2 referring to table has some field marked as Display=true?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:59 PM
then try this
current.field1=current.getDisplayValue('field2');
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 10:02 PM
I tried this but not working.