Name

global.AgileFixScriptUtils

Description

No description available

Script

var AgileFixScriptUtils = Class.create();

AgileFixScriptUtils.updateSysDocumentation = function(table, column, language, attribute, oldVal, newVal) {
  var gr = new GlideRecord("sys_documentation");

  gr.addQuery("name", table);
  gr.addQuery("element", column);
  gr.addQuery("language", language);
  gr.addQuery(attribute, oldVal);
  gr.query();

  if (gr.next()) {
      gr.setValue(attribute, newVal);

      if (gr.update())
          gs.info("sys_documentation for '" + table + "." + column + "' has been updated: attribute = " + attribute + ", value = " + newVal);
      else
          gs.error("Failed to update sys_documentation for '" + table + "." + column + "': attribute = " + attribute + ", value = " + newVal);
  }
};

AgileFixScriptUtils.deactivateRecords = function(tableName, sysIds) {
  sysIds.forEach(function(sysId) {
  	var gr = new GlideRecord(tableName);
  	if(gr.get(sysId)) {
  		gr.setValue('active', false);
  		gr.update();
  	}
  });
};

Sys ID

e80f1ceb737033003ade8889faf6a7ca

Offical Documentation

Official Docs: