Example - Next Page Processing through the ApplicationStack API
public void nextPageLinks() throws Exception
{
ApplicationStack appStackAddress = new ApplicationStack();
FormRequest formRequest = new FormRequest(loginEnv);
formRequest.setFormName("P0801_W0801A");
formRequest.setVersion("ZJDE0001");
formRequest.setReturnControlIDs("1[14,15]");
formRequest.setFormServiceAction("R");
formRequest.setMaxPageSize("25");
formRequest.setFindOnEntry(true);
//open P0801_W0801A
String response = appStackAddress.open(loginEnv, formRequest);
//Add Code here to marshal the response...
//continue fetching more records until no more 'next' links are received
while(appStackAddress.getLastAppStackResponse().getLinks()!=null && !appStackAddress.getLastAppStackResponse().getLinks().isEmpty()
&& appStackAddress.getLastAppStackResponse().getLinks().get(0).getRel().equals("next"))
{
//get more
response = appStackAddress.executeLink(loginEnv,appStackAddress.getLastAppStackResponse().getLinks().get(0));
//Add Code here to marshal each response...
}
//close
response = appStackAddress.close(loginEnv);
}
In this example, if the result set times out, the system throws a JDERestServiceException with the following message:
JDE Rest Service Call Failed: 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."}]}