Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 08:37 AM
Hi all,
I want to understand what should I need to do to call a same Script Include at both Server Side and Client side?
Solved! Go to Solution.
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 08:48 AM
You check the box "Client callable" on the script include and then you do something like the below. It will allow you to use the same method in both places.
var testUtil = Class.create();
testUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getSpendCategory: function(SOMEPARM) {
var varValueToUse = "";
if(SOMEPARM)
varValueToUse = SOMEPARM;
else
varValueToUse = this.getParameter("sysparm_SOMEPARM");
if(!varValueToUse)
return "";
//Do your work here and return a value.
},
type: 'testUtil'
});
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 08:48 AM
You check the box "Client callable" on the script include and then you do something like the below. It will allow you to use the same method in both places.
var testUtil = Class.create();
testUtil.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getSpendCategory: function(SOMEPARM) {
var varValueToUse = "";
if(SOMEPARM)
varValueToUse = SOMEPARM;
else
varValueToUse = this.getParameter("sysparm_SOMEPARM");
if(!varValueToUse)
return "";
//Do your work here and return a value.
},
type: 'testUtil'
});