Name
global.SearchSourceTableChoiceList
Description
No description available
Script
var SearchSourceTableChoiceList = Class.create();
SearchSourceTableChoiceList.prototype = {
initialize: function() {
},
process: function() {
var tl = new GlideTableChoiceList();
tl.setAll(true);
tl.setCanRead(true);
tl.setShowLabels(true);
tl.setSelectedOnly(false);
tl.setSelectedField(null);
tl.setSelected(null);
tl.setForceSelected(false);
tl.setNoViews(true);
tl.setNoSystemTables(true);
tl.setCurrentTableName(null);
tl.generateChoices();
var blacklist = new SearchSourceTableBlacklist().get();
return this.filterAndFormat(tl, blacklist);
},
filterAndFormat: function(tl, blacklist) {
var result = [];
for (var i = 0; i < tl.size(); i++) {
// The following String() typecast is needed for the blacklist is an array of strings and .getValue returns an object
var tableName = String(tl.getChoice(i).getValue());
if (blacklist.indexOf(tableName) < 0 && !tableName.startsWith("ts_") && tableName.indexOf("syslog")) {
result.push(tableName);
}
}
return result;
},
type: 'SearchSourceTableChoiceList'
};
Sys ID
28ec84e023301300f4b4c50947bf6569