Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

get Referenc was not working

ArunaTunga
Tera Contributor

am trying to alert logged in user name with get reference but it not working, am don't know why variable was greyed out even i have called it on function.

ArunaTunga_0-1771570242944.png

 

5 REPLIES 5

Tanushree Maiti
Giga Sage

Hi @ArunaTunga ,

Can you try with this:

function onChange(control, oldValue, newValue, isLoading) {

if (isLoading || !newValue)
return;

g_form.getReference('caller_id', caller);

g_form.getReference('assigned_to', assigned);
}

function caller(user){
var x = user.name.toString();
alert(x);
}

 

function assigned(assign){
var y = assign.name.toString();
alert(y);
}

 

Best Practice: It is highly recommended to use GlideAjax instead of getReference for better performance and reliability

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: