Name

sn_risk_advanced.AdvancedRiskUtilsBase

Description

No description available

Script

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

  updateRecordModCount: function(table, sysId) {
      this._updateRecordModCount(table, sysId);
  },

  getDictionaryFieldValue: function(table, columnName, attribute) {
      return this._getDictionaryFieldValue(table, columnName, attribute);
  },


  isRecordCustomised: function(updateName) {
      return this._isRecordCustomised(updateName);
  },

  _isRecordCustomised: function(updateName) {
      var update = new GlideRecord("sys_update_xml");
      update.addQuery("name", updateName);
      update.setLimit(1);
      update.query();
      return update.hasNext();
  },

  doesRecordSatisfyFilterQuery: function(table, recordSysId, encodedQuery) {
      return this._doesRecordSatisfyFilterQuery(table, recordSysId, encodedQuery);
  },

  _doesRecordSatisfyFilterQuery: function(table, recordSysId, encodedQuery) {
      var record = new GlideRecord(table);
      record.addEncodedQuery(encodedQuery);
      record.addQuery("sys_id", recordSysId);
      record.query();

      return record.hasNext();
  },

  _getDictionaryFieldValue: function(table, columnName, attribute) {
      var dictionary = new GlideRecord("sys_dictionary");
      dictionary.addQuery('name', table);
      dictionary.addQuery('element', columnName);
      dictionary.query();
      if (dictionary.next())
          return dictionary.getValue(attribute);
      return "";
  },

  _updateRecordModCount: function(table, sysId) {
      var record = new GlideRecord(table);
      record.get(sysId);
      record.sys_mod_count = record.sys_mod_count + 1;
      record.setWorkflow(false);
      record.update();
  },

  type: 'AdvancedRiskUtilsBase'
};

Sys ID

b368ffae43b02110bad150d556b8f233

Offical Documentation

Official Docs: