Execute Next Record Request v2

post

/jderest/v2/appstack/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 application stack if one or more grid exists in the response and any of those grids indicates there are more records available ("moreRecords" : true) then the response will include a links section. 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.

Example Request NEXT Output

Request - Open the stack with more records available for fetching.

curl -i -X POST -H "Content-Type:application/json" http://ais_server_url/jderest/v2/appstack -d
{
  "token" : "044Q0gPdxY/9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E=MDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg=",
  "ssoEnabled" : false,
  "showActionControls" : false,
  "includeTimings" : false,
  "allowCache" : true,
  "forceUpdate" : false,
  "setDirtyOnly" : false,
  "nextPageTimeInterval" : 0,
  "findOnEntry" : "TRUE",
  "maxPageSize" : "5",
  "returnControlIDs" : "1[14,15]",
  "formName" : "P0801_W0801A",
  "version" : "ZJDE0001",
  "formServiceAction" : "R",
  "bypassFormServiceEREvent" : true
}
        

Response - Open the stack

{
  "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" : 2006,
          "z_ALPH_15" : "AIS APP Stack TEST stack2"
        }, {
          "z_AN8_14" : 6002,
          "z_ALPH_15" : "Abbott, Dominique"
        }, {
          "z_AN8_14" : 6044,
          "z_ALPH_15" : "Abrams, Brooke"
        }, {
          "z_AN8_14" : 6078,
          "z_ALPH_15" : "Aiken, Gwen"
        }, {
          "z_AN8_14" : 8985155,
          "z_ALPH_15" : "Allan, Murray"
        } ],
        "summary" : {
          "records" : 5,
          "moreRecords" : true
        }
      }
    },
    "errors" : [ ],
    "warnings" : [ ]
  },
  "stackId" : 1,
  "stateId" : 1,
  "rid" : "4700afa5159cc076",
  "currentApp" : "P0801_W0801A_ZJDE0001",
  "timeStamp" : "2017-02-14:19.27.11",
  "sysErrors" : [ ],
  "links" : [ {
    "rel" : "next",
    "href" : "http://ais_server_url/jderest/v2/appstack/next?stackId=1&stateId=1&rid=4700afa5159cc076&fullGridId=1&formOID=W0801A&token=044Q0gPdxY%2F9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E%3DMDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg%3D&outputType=GRID_DATA&returnControlIDs=1[14,15]&nextPageTimeInterval=0",
    "context" : "1"
  } ]
}
        

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/appstack/next?stackId=1&stateId=1&rid=4700afa5159cc076&fullGridId=1&formOID=W0801A&token=044Q0gPdxY%2F9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E%3DMDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg%3D&outputType=GRID_DATA&returnControlIDs=1[14,15]&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/appstack/next?stackId=1&stateId=39&rid=4700afa5159cc076&fullGridId=1&formOID=W0801A&token=044Q0gPdxY%2F9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E%3DMDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg%3D&outputType=GRID_DATA&returnControlIDs=1[14,15]" -d

        

Response - Fetch last 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" : 7742,
          "z_ALPH_15" : "Wolfe, Harvey S."
        }, {
          "z_AN8_14" : 7726,
          "z_ALPH_15" : "Xian, Peng"
        }, {
          "z_AN8_14" : 7727,
          "z_ALPH_15" : "Yamamoto, Judy"
        }, {
          "z_AN8_14" : 8443,
          "z_ALPH_15" : "Zolinski, Paul L."
        }, {
          "z_AN8_14" : 7743,
          "z_ALPH_15" : "Zurowsky, Karen"
        } ],
        "summary" : {
          "records" : 5,
          "moreRecords" : false
        }
      }
    },
    "errors" : [ ],
    "warnings" : [ ]
  },
  "stackId" : 1,
  "stateId" : 40,
  "rid" : "4700afa5159cc076",
  "currentApp" : "P0801_W0801A_ZJDE0001",
  "timeStamp" : "2017-02-14:19.27.17",
  "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/appstack/next?stackId=1&stateId=39&rid=4700afa5159cc076&fullGridId=1&formOID=W0801A&token=044Q0gPdxY%2F9RZmiU9GAaYFhexug9ZgKJfTOrNudmeUR6E%3DMDE5MDEyNDI5MzczNjM2Mzg4NjM3Njk2NjE0OC44Ny4xOS40MDE0ODcxMDA0MzE1Nzg%3D&outputType=GRID_DATA&returnControlIDs=1[14,15]" -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