Skip to content

Commit 59f5578

Browse files
authored
Create Calling Script Include from client.js
This is on change client script to call the defined script include.
1 parent 2ade88b commit 59f5578

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
2+
if (isLoading || newValue === '') {
3+
return;
4+
}
5+
var aj = new GlideAjax("GetCallerDetails"); // This is the name of script include, as per the name of your requirement.
6+
aj.addParam('sysparm_name',"demoTest"); // This is calling a defined function in script include.
7+
aj.addParam('sysparm_caller_id',g_form.getValue('caller_id')); // getting a caller_id
8+
aj.getXML(callback);
9+
function callback(response){ // creating a callback function to store the response getting from script include.
10+
var answer = response.responseXML.documentElement.getAttribute('answer');
11+
alert(answer); // This will alert the details.
12+
}
13+
14+
}

0 commit comments

Comments
 (0)