- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 03:29 AM
I want to send one function(getOrderGuide) return value to second function(sendValues).
Please correct me if my approach is on track or i am missing somewhere.
Here is my script include.
var getOrderGuideValues = Class.create();
getOrderGuideValues.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getOrderGuide : function(test){ //function 1
var mahi = this.test;
answer = this.getParameter('sysparm_value');
return answer; //send this value to the "sendValues" function
},
sendValues : function(getOrderGuide){ //function 2
var value1;
var value2 = getOrderGuide;
if(...){
//some code;
}
return value2;
},
type: 'getOrderGuideValues'
});
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2017 03:32 AM
Hi Kshitiz,
You can use this code
var getOrderGuideValues = Class.create();
getOrderGuideValues.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getOrderGuide : function(test){ //function 1
var mahi = this.test;
answer = this.getParameter('sysparm_value');
var value = this.sendValues(answer);
return value; //send this value to the "sendValues" function
},
sendValues : function(getOrderGuide){ //function 2
var value1;
var value2 = getOrderGuide;
if(...){
//some code;
}
return value2;
},
type: 'getOrderGuideValues'
});
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-29-2017 03:32 AM
Hi Kshitiz,
You can use this code
var getOrderGuideValues = Class.create();
getOrderGuideValues.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getOrderGuide : function(test){ //function 1
var mahi = this.test;
answer = this.getParameter('sysparm_value');
var value = this.sendValues(answer);
return value; //send this value to the "sendValues" function
},
sendValues : function(getOrderGuide){ //function 2
var value1;
var value2 = getOrderGuide;
if(...){
//some code;
}
return value2;
},
type: 'getOrderGuideValues'
});
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-29-2017 03:39 AM
Hi Kshitiz,
You can call the other function value from another function inside the same Script include as below. You can call getOrderGuide function from sendValues function itself.
var abc = this.getOrderGuide(Param1, Param2);
And define the Script include as below:
getOrderGuide: function(Param1, Param2){
//Do your logic
}
I hope this helps.Please mark correct/helpful based on impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2017 09:54 AM
Hi kshitiz1,
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View