can we call scriptinclude inside script include and

Avinash_Patil1
Giga Guru

How to call scriptinclude inside scriptinclude 

2 REPLIES 2

SanjivMeher
Kilo Patron
Kilo Patron

Hi Avinash,

 

Yes. You can call a script include inside a script include using the same syntax you use when you call a script include in business rule.

For ex.

 

var myscript = new ScriptIncludeName();

myscript.functionname(parm1,parm2);


Please mark this response as correct or helpful if it assisted you with your question.

Lakshmaiah Dump
Giga Expert

 

Hi Avinash,

Yes. We can call the script include inside other script include.

 

Check it out following example,

1. SuperScript Include

find_real_file.png

Code:

var SuperScriptInclude = Class.create();
SuperScriptInclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  
	initialize:function(){		
	},
	
	parent :function(){
		var scObj = new global.ChildSciptInclude();
		return "Parent Script Include ->"+ scObj.child();
	},
	
    type: 'SuperScriptInclude'
});

 

2. ChildScript Inclide

find_real_file.png

Code:

var ChildSciptInclude = Class.create();
ChildSciptInclude.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    
	initialize:function(){
	},
	
	child:function(){
		return "ChildSciptInclude";
	},
	
    type: 'ChildSciptInclude'
});

 

Tested with background scripts.

find_real_file.png

 

Code:

var scObj = new global.SuperScriptInclude();
gs.print(scObj.parent());

 

Output of background script is,

find_real_file.png