Skip to content

Commit 593a819

Browse files
authored
Create script_include.js
Client callable script include
1 parent 29a48fc commit 593a819

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//Client callable script include
2+
var getSIRDetails = Class.create();
3+
getSIRDetails.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
4+
getDetails: function() {
5+
var sir = this.getParameter('sysparm_sir'); //getting the newValue of Security Inc from onChange client script
6+
var obj = {}; //declare an object
7+
var gr = new GlideRecord('sn_si_incident');
8+
gr.addQuery('sys_id', sir); //Query to security incident table with the newValue
9+
gr.query();
10+
if (gr.next()) {
11+
obj.severity = gr.severity.getDisplayValue(); //Setting values in the obj
12+
obj.state = gr.state.getDisplayValue();
13+
obj.assignedto = gr.assigned_to.getDisplayValue();
14+
}
15+
return JSON.stringify(obj); //passing the object to client script
16+
},
17+
type: 'getSIRDetails'
18+
});

0 commit comments

Comments
 (0)