In how many methods we can call script include in client scripts??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 10:15 PM
- 1. In how many methods we can call script include in client scripts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:34 PM
Hi Jai,
Are you looking to know how many times can we call script include methods in client script using GlideAjax, if yes then i think using GlideAjax we can call multiple methods or we can do multiple GlideAjax (not sure about the count, should be no limit ) with Asynchronous GlideAjax call using getXML() function. As per my understanding script include is a set of reusable methods which can be used/call multiple times. For example i just tried this without any issue.
function onLoad() {
var ajax = new GlideAjax('MyDateTimeAjax');
ajax.addParam('sysparm_name', 'firstfunction');
ajax.getXML(ajaxResponse);
function ajaxResponse(serverResponse) {
var answer = serverResponse.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
ajax.addParam('sysparm_name', 'secondfunction');
ajax.getXML(ajaxResponse1);
function ajaxResponse1(serverResponse) {
var answer = serverResponse.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
Script Include:
var MyDateTimeAjax = Class.create();
MyDateTimeAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
firstfunction : function () {
return 'Hello First Method';
},
secondfunction: function () {
return 'Hello Second Method';
},
}
Let us know if you are looking anything specific?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:38 PM
What are methods used in Risk calculation UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 12:15 AM
Calculate Risk UI Action just call one method setRisk from SetChangeRisk Script Include.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2023 01:21 AM
Hello, @Shishir Srivast I tried your script but its calls a second function onload of the form. It's not working for the first function. can you please guide me on this?
Thank You.