Name

global.ArchiveTableList

Description

Return a list of tables that can be used for archiving

Script

gs.include("PrototypeServer");

var ArchiveTableList = Class.create();

ArchiveTableList.prototype = {

  process: function() {
      var list = new Array();
      var dd = new GlideRecord('sys_dictionary');
      dd.addNullQuery('element');
      dd.addQuery('name', 'IN', this._getArchivedList());
      dd.query();
      while (dd.next())
          list.push(dd.name + '');
      return list;
  },

  _getArchivedList: function() {
      var list = new Array();
      var ar = new GlideRecord('sys_archive');
      ar.addQuery('api_only', false).addOrCondition('api_only', 'NULL');
      ar.query();
      while (ar.next())
          list.push('ar_' + ar.table + '');

      return list;
  },


  type: "ArchiveTableList"
};

Sys ID

9e02811c9f231000dada207c7f4bcc75

Offical Documentation

Official Docs: