Name
global.PmConsoleUtil
Description
Utilities for working with pm_console table Usage var pmConsoleUtil = new PmConsoleUtil(sys_class_name); pmConsoleUtil.
Script
var PmConsoleUtil = Class.create();
PmConsoleUtil.prototype = {
initialize: function(tableName) {
this.tableName = tableName;
},
isConsoleExist: function(entity, context) {
var consoleExist = false;
var consoles = 0;
var count = new GlideAggregate(this.tableName);
count.addQuery('entity', '=', entity);
count.addQuery('context', '=', context);
count.addAggregate('COUNT');
count.query();
if(count.next())
consoles = count.getAggregate('COUNT');
if(consoles > 0)
consoleExist = true;
return consoleExist;
},
type: 'PmConsoleUtil'
};
Sys ID
0ea9d0c20b713200d08dae9863673ab1