Name

global.PmConsoleAggregationHelper

Description

No description available

Script

var PmConsoleAggregationHelper = Class.create();
PmConsoleAggregationHelper.prototype = {
  initialize: function() {
  },

  type: 'PmConsoleAggregationHelper'
};

PmConsoleAggregationHelper.maxValue = function(table, column, filterQuery) {
  //gs.info("Into PmConsoleAggregationHelper.maxValue: " + table + " - " + column + " - " + filterQuery);
  var max = new GlideAggregate(table);
  max.addAggregate('MAX', column);
  max.addEncodedQuery(filterQuery);
  max.setGroup(false);
  max.query();
  //gs.info("maxValue query: " + max.getEncodedQuery());
  var agg = 0;
  if (max.next()) {
      var maxValue = max.getAggregate('MAX', column);
      if(JSUtil.notNil(maxValue))
          agg = parseInt(maxValue);
  }
  //gs.info("maxValue: " + agg);
  return agg;
};

Sys ID

462a5e9e9f231200598a5bb0657fcf1f

Offical Documentation

Official Docs: