Execute Next Record Request v2

post

/jderest/v2/dataservice/next

Execute stateful calls to get the next record set for a grid.

Request

Query Parameters
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

Successful Execution

400 Response

Bad Request - Invalid JSON Input

403 Response

Authorization Failure

415 Response

Invalid Content-Type Header - Must use application/json

500 Response

Server Failed to Process Request
Body ()
Root Schema : ServiceErrorResponse
Type: object
Error Response
Show Source
Back to Top

Examples

This example shows how to fetch data in easily manageable chunks over several successive service calls. In order to use the new next/link capability you must use the V2 services, by including V2 in the uri. The token value is from a prior call to the tokenrequest service to establish a session. For data service calls you must indicate on the first call that you expect to receive next page links, this indication on the request keeps the data set open waiting to receive the next requests. Set the ???enableNextPageProcessing??? parameter to true. When this is configured in the first call, if there are additional records to be fetched you will receive a links section in the response. It is important to note that the size of each data set is determined up front, with the first request to that form/grid. The maxPageSize input parameter indicates the chunk size for each call. So setting this value to 10 for example, means in the first call you will get 10, and every subsequent link call after that you will get up to 10. Data Request next page processing has one additional request parameter called ???nextPageTimeInterval??? this setting controls a process in the background we???ll call ???data dripping???. When this parameter is not passed the data dripping is turned on and the data is fetched from the database silently in the background at 5 second intervals awaiting the next call. When the next call occurs it fetches whatever is remaining up to the maxPageSize. When this parameter is set to 1000 milliseconds or less, data dripping is turned off. You can still perform next calls, but the entire next section is fetch at the time of the next call. When this parameter is set to a value greater than 1000, but less than the configured jdbj.ini resultSetTimeout, then the records will be silently fetch for the time interval provided.

Example Request NEXT Output

Request - Data request with more records available for fetching.

curl -i -X POST -H "Content-Type:application/json" http://ais_server_url/jderest/v2/dataservice -d
{
  "token" : "044jIq0M09dQAG+NdPc2xPANg89RO+JvG0VnwwCEp7mQ5U=MDE5MDEyNzIzOTM5NzM3MTk4NzQ4MTk2MDE0OC44Ny4xOS40NjE0ODcxMDYxNzg3Mjg=",
  "ssoEnabled" : false,
  "aliasNaming" : true,
  "showActionControls" : false,
  "includeTimings" : false,
  "allowCache" : true,
  "forceUpdate" : false,
  "setDirtyOnly" : false,
  "nextPageTimeInterval" : 0,
  "findOnEntry" : "TRUE",
  "maxPageSize" : "5",
  "returnControlIDs" : "F0101.AN8|F0101.ALPH|F0101.AT1",
  "targetName" : "F0101",
  "targetType" : "table",
  "dataServiceType" : "BROWSE",
  "enableNextPageProcessing" : true,
  "nextPageTimeInterval1" : "0"
}
        

Response - Data request

{
  "fs_DATABROWSE_F0101" : {
    "title" : "Data Browser - F0101 [Address Book Master]",
    "data" : {
      "gridData" : {
        "id" : 54,
        "fullGridId" : "54",
        "columns" : {
          "F0101_AN8" : "Address Number",
          "F0101_ALPH" : "Alpha Name",
          "F0101_AT1" : "Sch Typ"
        },
        "rowset" : [ {
          "F0101_AT1" : "O",
          "F0101_AN8" : 1,
          "F0101_ALPH" : "Financial/Distribution Company"
        }, {
          "F0101_AT1" : "E",
          "F0101_AN8" : 7,
          "F0101_ALPH" : "NL Test"
        }, {
          "F0101_AT1" : "O",
          "F0101_AN8" : 9,
          "F0101_ALPH" : "Multi-Site Target Company"
        }, {
          "F0101_AT1" : "O",
          "F0101_AN8" : 20,
          "F0101_ALPH" : "Vision Corporation"
        }, {
          "F0101_AT1" : "F",
          "F0101_AN8" : 27,
          "F0101_ALPH" : "Eastern Area Distribution Center"
        } ],
        "summary" : {
          "records" : 5,
          "moreRecords" : true
        }
      }
    },
    "errors" : [ ],
    "warnings" : [ ]
  },
  "stackId" : 1,
  "stateId" : 1,
  "rid" : "6325a62aafdbc676",
  "currentApp" : "DATABROWSE_F0101",
  "timeStamp" : "2017-02-14:21.02.58",
  "sysErrors" : [ ],
  "links" : [ {
    "rel" : "next",
    "href" : "http://ais_server_url/jderest/v2/dataservice/next?stackId=1&stateId=1&rid=6325a62aafdbc676&fullGridId=54&formOID=F0101&token=044jIq0M09dQAG%2BNdPc2xPANg89RO%2BJvG0VnwwCEp7mQ5U%3DMDE5MDEyNzIzOTM5NzM3MTk4NzQ4MTk2MDE0OC44Ny4xOS40NjE0ODcxMDYxNzg3Mjg%3D&outputType=GRID_DATA&returnControlIDs=F0101.AN8|F0101.ALPH|F0101.AT1&nextPageTimeInterval=0"
  } ]
}
        

To request the next page of data you use the link provided and do a POST operation for that URL.

Request - Fetch next set of data

curl -i -X POST -H "Content-Type:application/json" "http://ais_server_url/jderest/v2/dataservice/next?stackId=1&stateId=1&rid=6325a62aafdbc676&fullGridId=54&formOID=F0101&token=044jIq0M09dQAG%2BNdPc2xPANg89RO%2BJvG0VnwwCEp7mQ5U%3DMDE5MDEyNzIzOTM5NzM3MTk4NzQ4MTk2MDE0OC44Ny4xOS40NjE0ODcxMDYxNzg3Mjg%3D&outputType=GRID_DATA&returnControlIDs=F0101.AN8|F0101.ALPH|F0101.AT1&nextPageTimeInterval=0" -d

        

Response - Fetch next records

{
  "fs_P0801_W0801A" : {
    "title" : "Work With Employee Information",
    "data" : {
      "gridData" : {
        "id" : 1,
        "fullGridId" : "1",
        "columns" : {
          "z_AN8_14" : "Employee No",
          "z_ALPH_15" : "Alpha Name"
        },
        "rowset" : [ {
          "z_AN8_14" : 8011,
          "z_ALPH_15" : "Watkins, Joshua"
        }, {
          "z_AN8_14" : 8985159,
          "z_ALPH_15" : "Watson, Shane"
        }, {
          "z_AN8_14" : 201112,
          "z_ALPH_15" : "Weaver, Kristin"
        }, {
          "z_AN8_14" : 7720,
          "z_ALPH_15" : "White, Gordon A."
        }, {
          "z_AN8_14" : 7725,
          "z_ALPH_15" : "Wieczoek, Dorothy"
        } ],
        "summary" : {
          "records" : 5,
          "moreRecords" : true
        }
      }
    },
    "errors" : [ ],
    "warnings" : [ ]
  },
  "stackId" : 1,
  "stateId" : 39,
  "rid" : "4700afa5159cc076",
  "currentApp" : "P0801_W0801A_ZJDE0001",
  "timeStamp" : "2017-02-14:19.27.17",
  "sysErrors" : [ ],
  "links" : [ {
    "rel" : "next",
    "href" : "http://ais_server_url/jderest/v2/appstack/next?stackId=1&stateId=39&rid=4700afa5159cc076&fullGridId=1&formOID=W0801A&token=044Q0gPdxY%2F9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E%3DMDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg%3D&outputType=GRID_DATA&returnControlIDs=1[14,15]",
    "context" : "1"
  } ]
}
        

To request the last page of data you use the link provided and do a POST operation for that URL.

Request - Fetch last set of data

curl -i -X POST -H "Content-Type:application/json" "http://ais_server_url/jderest/v2/dataservice/next?stackId=1&stateId=190&rid=51572135de670704&fullGridId=54&formOID=F0101&token=044qrAmEGGr40L2HpzM5sleoL0gxAFiFn5jvEzqskPlXe4%3DMDE5MDEyMzI2Njk0Njc2MDUxNzU0ODM0MTE0OC44Ny4xOS40NTE0ODcxMDg4NjczMDE%3D&outputType=GRID_DATA&returnControlIDs=F0101.AN8|F0101.ALPH|F0101.AT1&nextPageTimeInterval=0" -d

        

Response - Fetch last records

{
  "fs_DATABROWSE_F0101" : {
    "title" : "Data Browser - F0101 [Address Book Master]",
    "data" : {
      "gridData" : {
        "id" : 54,
        "fullGridId" : "54",
        "columns" : {
          "F0101_AN8" : "Address Number",
          "F0101_ALPH" : "Alpha Name",
          "F0101_AT1" : "Sch Typ"
        },
        "rowset" : [ {
          "F0101_AT1" : "X",
          "F0101_AN8" : 55555555,
          "F0101_ALPH" : "Ludwig, Hans"
        }, {
          "F0101_AT1" : "TAX",
          "F0101_AN8" : 88888888,
          "F0101_ALPH" : "Tax Authority"
        }, {
          "F0101_AT1" : "TAX",
          "F0101_AN8" : 99999999,
          "F0101_ALPH" : "Treasury Department"
        } ],
        "summary" : {
          "records" : 3,
          "moreRecords" : false
        }
      }
    },
    "errors" : [ ],
    "warnings" : [ ]
  },
  "stackId" : 1,
  "stateId" : 191,
  "rid" : "51572135de670704",
  "currentApp" : "DATABROWSE_F0101",
  "timeStamp" : "2017-02-14:21.48.16",
  "sysErrors" : [ ],
  "links" : [ ]
}
        

Finally, in any case it is possible that the result set will time out and calling the next link will result in an exception, so you must handle this possibility. In the case of a timeout you will have to start over and re-run the original fetch to refresh the data set.

Request - Fetch next data fail

curl -i -X POST -H "Content-Type:application/json" "http://ais_server_url/jderest/v2/dataservice/next?stackId=1&stateId=190&rid=51572135de670704&fullGridId=54&formOID=F0101&token=044qrAmEGGr40L2HpzM5sleoL0gxAFiFn5jvEzqskPlXe4%3DMDE5MDEyMzI2Njk0Njc2MDUxNzU0ODM0MTE0OC44Ny4xOS40NTE0ODcxMDg4NjczMDE%3D&outputType=GRID_DATA&returnControlIDs=F0101.AN8|F0101.ALPH|F0101.AT1&nextPageTimeInterval=0" -d

        

Response - Fetch next data fail

Status: 500 
{
    "sysErrors": [
        {
            "TITLE": "JAS_MSG347: The query results expired.  Refresh them by clicking Find again.",
            "DESC": "JAS_MSG347: The query results expired.  Refresh them by clicking Find again."
        }
    ]
}

        
Back to Top