Skip to content

Commit f1d3ca4

Browse files
authored
Create script.js
Onchange client script to call a script include and extract values passed via object and setting it in appropriate fields.
1 parent 593a819 commit f1d3ca4

File tree

1 file changed

+31
-0
lines changed
  • Client Scripts/Set Severity, state & assigned to

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//onChange client script
2+
3+
4+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
5+
if (isLoading || newValue === '') {
6+
7+
8+
return;
9+
}
10+
11+
12+
//Type appropriate comment here, and begin script below
13+
14+
15+
var ga = new GlideAjax('getSIRDetails');
16+
ga.addParam('sysparm_name', 'getDetails');
17+
ga.addParam('sysparm_sir', newValue);
18+
ga.getXMLAnswer(callBackFunction);
19+
20+
21+
22+
23+
function callBackFunction(response) {
24+
var ans = JSON.parse(response);
25+
g_form.setValue('severity', ans.severity);
26+
g_form.setValue('soc_sir_state', ans.state);
27+
g_form.setValue('soc_sir_assigned_to', ans.assignedto);
28+
29+
30+
}
31+
}

0 commit comments

Comments
 (0)