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
‎09-20-2018 02:22 PM
change it to
var gr = new GlideRecord('incident');
gr.get('74e44b57db6c23009cf817803996191e'); // sys_id
gr.getDisplayValue('number');
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2018 09:47 PM
thanks prateek, if I do the same in background script it displays but not in UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2018 02:38 AM
can you share your ui action code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2018 04:04 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2018 06:28 AM
you did not put any log or gs.addInfoMessage() to display the result.
what is your exact requirement here.
adding few of the sample example here.
UI Action name: test
Show update: true // it means it will visible on the existing record
Client: true
onClick : Ontest(); // i defined my client side function name here.
Script :-
//client side function to do all the operation at client side
function Ontest() {
alert('hello all');
gsftSubmit(null, g_form.getFormElement(), 'test_test');
}
if(typeof window == 'undefined')
test();
//server side function to make any operation at server end
function test()
{
var gr = new GlideRecord('problem');
gr.get('sys_id','5d3b0ac1dbeb5340e4d95740cf961905');
gs.addInfoMessage(gr.getDisplayValue('number'));
action.setRedirectURL(current);
}
Hope it will help you