AnsweredAssumed Answered

jobID returned as undefined

Question asked by chadhawkins on Sep 14, 2012
Latest reply on Sep 14, 2012 by geos_rfleet
Hi all,

I'm running into an issue retrieving the jobID of an asynchronous geoprocessing job. I am able to retrieve the jobStatus but the jobID is returned as undefined. I am using Internet Explorer 9 (due to interaction elsewhere in the code with ActiveX) and Server 10.0.0.0. As you can see below, the API is being hosted on my server because eventually the application will run on a server with no Internet connection, but the result is the same with the ESRI-hosted API. The relevant portions of the code are below:

<script type="text/javascript" src="http://server/arcgis_js_api/library/3.1/jsapi/"></script> <script language="javascript">  function geoprocessing(){         // returns an array of well-known text values;  var polyArray = retrieveValues();  var gpurl = "http://server/ArcGIS/rest/services/ls_geoproc/GPServer/Landscan";  gp = new esri.tasks.Geoprocessor(gpurl);  var params = { "WKT":polyArray };   gp.submitJob(params, completeCallback, statusCallback); }  function statusCallback(jobInfo){  console.log(jobInfo.jobStatus); }  function completeCallback(jobInfo){  console.log(jobInfo.jobID);  console.log(jobinfo.jobStatus); }


Here are the print statements from the console log:

LOG: esriJobSubmitted  LOG: esriJobExecuting  LOG: esriJobSucceeded  LOG: undefined  [object Error]  [object Error] 


The job does in fact succeed (not sure why the object errors are occuring, could be related somehow?). Does anything look amiss in my code?

Any help is greatly appreciated.

Outcomes