Name

sn_cai.ResultPage

Description

Represents a page from common layer API invocation, provides handy getters to read the response and page metadata.

Script

/**
* <h3>Scope: This is ServiceNow Instance side class</h3>
* POJO object represents a Result Page
* @class
* @memberof sn_cloud_access_la
* @alias ResultPage
* 
*/
var ResultPage = Class.create();
ResultPage.prototype = {
  initialize: function (gr) {
  	this._response = gr.getValue('u_page_response');
  	this._pageNumber = gr.getValue('u_page_number');
  	this._requestId = gr.getValue('u_request_id');
  	this._isFinalResponse = gr.getValue('u_is_final_response');
  	this._totalPages = gr.getValue('u_total_pages');
  },
  /**
   * get response in the form of string ( could be json string or xml string)
   * @returns {string} 
   */
  getResponse: function () {
  	return this._response;
  },
  /**
   * get current page number
   * @returns {number}
   */
  getPageNumber: function () {
  	return this._pageNumber;
  },
  /**
   * returns the requestId for which the response is received
   * @returns {string}
   */
  getRequestId: function () {
  	return this._requestId;
  },
  /**
   * is it a final page or have more pages
   * @returns {boolean}
   */
  isFinalPage: function () {
  	return this._isFinalResponse;
  },
  /**
   * get total number of pages
   * @returns {number} total number of pages
   */
  getTotalPages: function () {
  	return this._totalPages;
  },
  type: 'ResultPage'
};

Sys ID

a83f617153931010d53bddeeff7b12c7

Offical Documentation

Official Docs: