Skip to content

Commit 6a5f90a

Browse files
authored
Create ClientCallableScriptInclude.js
1 parent b43f992 commit 6a5f90a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* The following is a client callable script include. This can be used with the onChange Client script to be able to gather the data on the server side
3+
*/
4+
5+
var ReferenceQualifierAjaxHelper = Class.create();
6+
ReferenceQualifierAjaxHelper.prototype = Object.extendsObject(AbstractAjaxProcessor, {
7+
getUserInformation : function() {
8+
var userID = this.getParameter('sysparm_user');
9+
var userRec = new GlideRecord('sys_user');
10+
11+
if(userRec.get(userID)) {
12+
var results = {
13+
"email" : userRec.getValue('email'),
14+
"department" : userRec.getValue('department'),
15+
"title" : userRec.getValue('title'),
16+
"phone" : userRec.getValue('phone')
17+
};
18+
19+
return JSON.stringify(results)
20+
}
21+
22+
},
23+
24+
type: 'ReferenceQualifierAjaxHelper'
25+
});

0 commit comments

Comments
 (0)