- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:41 AM
Is it possible to declare multiple functions inside script include and call it from business rule.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 06:04 AM
use "this" for calling an internal function in the same script include
NewInclude.prototype = {
initialize: function() {},
myFunction: function() {
//function code here
},
mySecondFunction: function() {
//function code here
},
myThirdFunction: function() {
//function code here
// calling an internal function in the same script include user the keyword this.functionname
this.mySecondFunction();
},
myForthFunction: function() {
//function code here
//calling an external fucntion form another script include
var tool = new mySecondScriptInclude()
return tool.myExternalSubFunction(arg1,arg2);
},
type: 'NewInclude'
};

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:56 AM
Yes, that is possible. If you look at the code in this docs article, you can just add more functions like so:
var NewInclude = Class.create();
NewInclude.prototype = {
initialize: function() {},
myFunction: function() {
//function code here
},
mySecondFunction: function() {
//function code here
},
type: 'NewInclude'
};
And then call them like this:
var foo =new NewInclude();
foo.myFunction();
foo.mySecondFunction();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 05:58 AM
Gah. You know when you write out a reply and then scroll down and someone else has written the same thing but quicker...well, that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 06:03 AM
I want to call second function inside first function like
myfunction : function(){
var x=mySecondfunction(<Parameter>)
}
mySecondfunction(<parameter>)
{
return X;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2019 06:04 AM
use "this" for calling an internal function in the same script include
NewInclude.prototype = {
initialize: function() {},
myFunction: function() {
//function code here
},
mySecondFunction: function() {
//function code here
},
myThirdFunction: function() {
//function code here
// calling an internal function in the same script include user the keyword this.functionname
this.mySecondFunction();
},
myForthFunction: function() {
//function code here
//calling an external fucntion form another script include
var tool = new mySecondScriptInclude()
return tool.myExternalSubFunction(arg1,arg2);
},
type: 'NewInclude'
};