how to get display value?

Kiddy1
Tera Contributor

explorenow srinivasthelu Developer Community

var fake=current.u_fake;

var fake2='op'+fake.getDisplayValue();

is this correct?

19 REPLIES 19

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

jiu
Kilo Contributor

thanks prateek, if I do the same in background script it displays but not in UI action 

can you share your ui action code?

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