- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2023 03:41 AM
Hi,
have the table u_merkaz_tom with the string field 'u_calculation'. This field holds inside a name of a script include and a function name, for example:
Median().isMedian()
How can I glide record this table and execute the script includes one by one according to the value inside 'u_calculation'.
I tried this way but its not working (im not getting the log):
var reportsMerkazTom = Class.create();
reportsMerkazTom.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isTest: function() {
var gr = new GlideRecord('u_merkaz_tom_reports');
gr.query();
while(gr.next()) {
var part = gr.u_calculation.toString();
var scriptIncludeName = part.split('.')[0];
var funcName = part.split('.')[1];
var scriptIncludeGR = new GlideScriptInclude(scriptIncludeName);
scriptIncludeGR[funcName]();
}
},
type: 'reportsMerkazTom'
});
var Median = Class.create();
Median.prototype = Object.extendsObject(AbstractAjaxProcessor, {
isMedian: function() {
gs.log('Mays');
},
type: 'Median'
});
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2023 05:35 AM
@Alon Grod Update your script include function script like below. This should work for you
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2023 05:35 AM
@Alon Grod Update your script include function script like below. This should work for you
ServiceNow Community Rising Star, Class of 2023