If you want to be able to use a client callable script include in other script includes as well, make sure you allow for the input param (in this case id
) to be provided as a function argument and the GlideAjax sysparm_
input.
var SomeClass = Class.create();
SomeClass.prototype = Object.extendsObject(AbstractAjaxProcessor, {
type: "SomeClass",
getSomething: function(id) {
// This will allow you to call the "getSomething" function client-side
// and server-side both having an option to fill the id value
id = this.getParameter("sysparm_id") || id;
// Some code
...
// Return the data
return data;
}
}