Function within Script Include is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 01:39 AM
Hello All,
I know this is very simple code in server side script but why it is not working I am very amaze.. .
gs.print('I am running '+ this._gettest('da','Hello Sir'));
function _gettest(target,query) {
gs.print(target + query);
}
Thanks all !!
Regards,
SS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 02:06 AM
Calling script include using BR and within same script include function calling other function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 02:12 AM
You can add this code in your script include
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function() {
},
MyFunction : function(){
this._gettest("script include", "test");
},
_gettest : function (target,query) {
gs.log(target + query);
},
type: 'MyScriptInclude'
};
And call in from your BR
var me = new MyScriptInclude();
me.MyFunction();
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 03:05 AM
Thanks for your response, However, I get response as undefined. When I call a function in the end I say
Return ('Hello Something');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 03:08 AM
Did the above code worked? I am not sure how you have written the return code
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2017 04:04 AM
/////////////////// This is my Script Include ////////////
maintest: function() {
var getva = this.getTest('da',agg.value);
gs.log(getva);
},
getTest: function(target,query) {
try {
return (target + query);
}
catch(ex) {
var message = ex.getMessage();
}
},
BR///////////////////////////
var test = new TEST(); /// main Script Include
test.maintest();
This I am try to do .. but not working...