how to get display value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 08:38 PM
explorenow srinivasthelu Developer Community
var fake=current.u_fake;
var fake2='op'+fake.getDisplayValue();
is this correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 12:04 AM
Try this
var fake = current.u_fake.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 03:40 AM
Hi,
The code would not work if its used in client script,
then use:
g_form.getDisplayBox('field_name').value ; //the field needs to be a reference field..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 04:02 AM
In Server side script as current can only be used in Server Side Script:
var fake2='op'+current,u_fake.getDisplayValue();
Try to use gs.log(current,u_fake.getDisplayValue()) and see what value it is returning in order to proceed further.
Regards,
Shamma

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2017 06:15 AM
there are multiple ways to get the reference field value.
- var fake2 = 'op' + ' ' +current.getDisplayValue('u_fake');
- var fake2 = 'op' + ' ' +current.u_fake.getDisplayValue();
both will work
9.4 getDisplayValue
public String getDisplayValue()
- Retrieves the display value for the current record.
- Returns:
- String - a string display value for the current record.
- Example:
// list will contain a series of display values separated by a comma // array will be a javascript array of display values
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2018 05:05 AM
Hi,
I just wanted to print the incident number value by using UI action (server side)
var gr = new GlideRecord('incident');
gr.get('74e44b57db6c23009cf817803996191e'); // sys_id
current.getDisplayValue('number');
can any one help me in display the same
thanks in advance