Skip to content

Commit c850cc7

Browse files
authored
Create GlideAjaxCallerInfo.js
1 parent 4989ec6 commit c850cc7

File tree

1 file changed

+22
-0
lines changed
  • Client-Side Components/Client Scripts/Display Custom Field Based on Incident Channel Field and populate with Caller Information

1 file changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var CallerInfoHelper = Class.create();
2+
CallerInfoHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
3+
4+
getCallerInfo: function() {
5+
var callerSysId = this.getParameter('sysparm_caller');
6+
if (!callerSysId)
7+
return JSON.stringify({ email: '', mobile: '' });
8+
9+
var userGR = new GlideRecord('sys_user');
10+
if (!userGR.get(callerSysId))
11+
return JSON.stringify({ email: '', mobile: '' });
12+
13+
var userObj = {
14+
email: userGR.email.toString(),
15+
mobile: userGR.mobile_phone.toString()
16+
};
17+
18+
return JSON.stringify(userObj);
19+
},
20+
21+
type: 'CallerInfoHelper'
22+
});

0 commit comments

Comments
 (0)