Can any one explain how to call script include from business rule. please explain the differences between ondemand /classless , extend an exising class and define a new class.

Kalpana10
Giga Contributor

Hi All,

 

 

Can any one explain how to call script include from business rule. please explain the differences between ondemand /classless , extend an exising class  and define a new class.

1 ACCEPTED SOLUTION

Sudhanshu Talw1
Tera Guru

Script Includes are ondemand reusable server side code. 

Class based where you define something like this:

var NewInclude =Class.create();
 
NewInclude.prototype={
   initialize :function(){},
 
   myFunction :function(){//Put function code here},
 
   type :'NewInclude'};

Call this in your BR as:
var foo =new NewInclude();
foo.myFunction();

Classless: is basically you create when your SI has only single function in case of mutplie functions in your SI you should define Class full.

For calling SI via client script you should use GlideAjax API.

View solution in original post

5 REPLIES 5

Sudhanshu Talw1
Tera Guru

Script Includes are ondemand reusable server side code. 

Class based where you define something like this:

var NewInclude =Class.create();
 
NewInclude.prototype={
   initialize :function(){},
 
   myFunction :function(){//Put function code here},
 
   type :'NewInclude'};

Call this in your BR as:
var foo =new NewInclude();
foo.myFunction();

Classless: is basically you create when your SI has only single function in case of mutplie functions in your SI you should define Class full.

For calling SI via client script you should use GlideAjax API.