Name

global.KBMyKnowledgeAJAXSNC

Description

WARNING Customers should NOT modify this script The purpose of this script include is to provide default AJAX behaviours for the widgets on My Knowledge page. To change the behaviour of these methods (or add new methods), customers should override/add new methods to the KBMyKnowledgeAJAX script include.

Script

var KBMyKnowledgeAJAXSNC = Class.create();

KBMyKnowledgeAJAXSNC.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  getArticles: function() {
      var type = this.getParameter("sysparm_type");
      var windowStart = this.getParameter("sysparm_window_start");
  	var isDoctype = this.getParameter("sysparm_is_doctype");
      var response = {};

      var myKnowledge = new KBMyKnowledge(type, windowStart);
      var articles = myKnowledge.getArticles();

      var jr = new GlideJellyRunner();
      jr.setEscaping(false);
      jr.setVariable("jvar_type", type);
  	jr.setVariable("jvar_is_doctype", isDoctype);
      jr.setVariable("jvar_results", articles.results);

      response["htmlResult"] = jr.runMacro("kb_my_" + type);
      response["data"] = articles;

      return (new JSON()).encode(response);
  }
});

Sys ID

78130de0ef403100438236caa5c0fb07

Offical Documentation

Official Docs: