Execute Next Record Request v2
/jderest/v2/appstack/next
Request
-
deviceName: string
The deviceName associated with the token.
-
formOID: string
The currently open form to request the next grid action on.
-
fullGridId: string
The grid id you are requesting the next record set for.
-
outputType: string
The outputType/format for the JSON response.
-
returnControlIDs: string
The return control IDs for this request.
-
rid: string
The rid id for the current open application.
-
stackId: integer(int32)
The stack id for the current open application.
-
stateId: integer(int32)
The state id for the current open application.
-
token: string
The token for the current session.
-
jde-AIS-Auth(optional): string
Token
-
jde-AIS-Auth-Device(optional): string
Device Name
-
jde-AIS-MonitorOnStart(optional): boolean
Monitor on Start
-
jde-AIS-MonitorRequest(optional): string
Monitor RequestAllowed Values:
[ "monitorRequest", "monitorRequestIO" ]
Response
- application/json
200 Response
400 Response
403 Response
415 Response
500 Response
object
-
errorText(optional):
string
-
exception(optional):
string
The class of the exception if an exception was thrown.
-
exceptionId(optional):
string
ExceptionId, only if an exception record was written to the F980060
-
message(optional):
string
Details about the error.
-
status(optional):
string
Allowed Values:
[ "ERROR", "WARNING" ]
Status determined by exception handling -
timeStamp(optional):
string
The timestamp indicating the time the error message was returned.
-
type(optional):
string
Optional type of error
-
userDefinedErrorText(optional):
string
Optional error text added to an orchestration step.
Examples
This example shows how to use the next/link capability to fetch data in easily manageable data sets over several successive service calls. This capability is available with v2 services, which you can access by including v2 in the URI. The token value is from a prior call to the tokenrequest service to establish a session. An application stack response may include one or more grids. If any of the grids indicate more records are 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 in the first request to the form/grid. The maxPageSize input parameter indicates the number of records to return with each call. For example, setting this value to 10 means that you will receive 10 records in the first call and up to 10 more in every subsequent link call.
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 GET operation for that URL.
Request - Fetch next set of data
curl -X GET -H "Authorization: Basic SkRFOkpERQ==" "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"
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" } ] }
When no more records are available to fetch the moreRecords flag will be false, and you will no longer get a link the response for that grid.
Request - Fetch last records
curl -X GET -H "Authorization: Basic SkRFOkpERQ==" "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]"
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 -X GET -H "Authorization: Basic SkRFOkpERQ==" "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]"
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." } ] }