Skip to content

Instantly share code, notes, and snippets.

@hawkerboy7
Last active January 4, 2018 14:32
Show Gist options
  • Save hawkerboy7/df6c15e562c13cefe1cc07779117a37c to your computer and use it in GitHub Desktop.
Save hawkerboy7/df6c15e562c13cefe1cc07779117a37c to your computer and use it in GitHub Desktop.
Script Include CC (Client Callable)

Script Include CC (Client Callable)

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;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment