The CreatorCon Call for Content is officially open! Get started here.

The callers location should be popped-up (alert) when opening a record.

keerthana
Tera Contributor

BR:

g_scratchpad.v=current.caller_id.location.getDisplayvalue();

 

 

CS:

ONLOAD

 

var v=g_scratchpad.v;
alert("the caller location is",v);

 

 

didn't get output, please share any correction?

1 ACCEPTED SOLUTION

Pavankumar_1
Mega Patron

Hi @keerthana ,

try below script it will work.

1. Display Business rule

(function executeRule(current, previous /*null when async*/) {
	g_scratchpad.v = current.caller_id.location.name;

})(current, previous);

2.On load client script

function onLoad() {
	var v=g_scratchpad.v;
	alert("the caller location is" +v);

}

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

8 REPLIES 8

Check if user has location populated in your instance.

Best Regards
Aman Kumar

how to check?

Pavankumar_1
Mega Patron

Hi @keerthana ,

try below script it will work.

1. Display Business rule

(function executeRule(current, previous /*null when async*/) {
	g_scratchpad.v = current.caller_id.location.name;

})(current, previous);

2.On load client script

function onLoad() {
	var v=g_scratchpad.v;
	alert("the caller location is" +v);

}

 

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

thanks. i got ans....