<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: jobID returned as undefined in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589183#M55061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;D'oh! It was staring right at me and I managed to overlook it&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Me too! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I have attached the network log resulting from the job submittal in case that offers any insights.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It's the response content that would probably yield more answers - select the entry of interest (probably the last one) and then go to the "Detail View" - either double-click the entry or click the button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd still go for whacking a breakpoint in your code anyway, literally:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function completeCallback(jobInfo){
&amp;nbsp;&amp;nbsp;&amp;nbsp; debugger; //Poor man's breakpoint ;-)
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:18:24 GMT</pubDate>
    <dc:creator>__Rich_</dc:creator>
    <dc:date>2021-12-12T01:18:24Z</dc:date>
    <item>
      <title>jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589178#M55056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;lt;script type="text/javascript" src="http://server/arcgis_js_api/library/3.1/jsapi/"&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;script language="javascript"&amp;gt;&amp;nbsp; function geoprocessing(){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // returns an array of well-known text values;&amp;nbsp; var polyArray = retrieveValues();&amp;nbsp; var gpurl = "http://server/ArcGIS/rest/services/ls_geoproc/GPServer/Landscan";&amp;nbsp; gp = new esri.tasks.Geoprocessor(gpurl);&amp;nbsp; var params = { "WKT":polyArray };&amp;nbsp;&amp;nbsp; gp.submitJob(params, completeCallback, statusCallback); }&amp;nbsp; function statusCallback(jobInfo){&amp;nbsp; console.log(jobInfo.jobStatus); }&amp;nbsp; function completeCallback(jobInfo){&amp;nbsp; console.log(jobInfo.jobID);&amp;nbsp; console.log(jobinfo.jobStatus); }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are the print statements from the console log:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;LOG: esriJobSubmitted&amp;nbsp; LOG: esriJobExecuting&amp;nbsp; LOG: esriJobSucceeded&amp;nbsp; LOG: undefined&amp;nbsp; [object Error]&amp;nbsp; [object Error] &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 11:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589178#M55056</guid>
      <dc:creator>ChadHawkins</dc:creator>
      <dc:date>2012-09-14T11:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589179#M55057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Wonder if additionally passing an error callback would reveal more information?&amp;nbsp; Alternatively stick a breakpoint into your completeCallback and have a look at what's in the jobInfo argument.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suspect that what's being passed into your completeCallback method is &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; an object of type &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/jobinfo.htm"&gt;JobInfo&lt;/A&gt;&lt;SPAN&gt; more likely it's an &lt;/SPAN&gt;&lt;A href="https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error"&gt;Error&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; (that's what the lines from your console output suggest anyway)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way, I'd check it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Additionally you could also look at the traffic to and from the server and look at the 'raw' responses.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 11:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589179#M55057</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2012-09-14T11:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589180#M55058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply. I made the following changes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function geoprocessing(){
 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, errorCallback);
}

function statusCallback(jobInfo){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // try to print the jobID here as well;
 console.log(jobInfo.jobID);
 console.log(jobInfo.jobStatus);
}

function completeCallback(jobInfo){
 console.log(jobInfo.jobID);
 console.log(jobinfo.jobStatus);
}

function errorCallback(error){
 console.log(error.name);
 console.log(error.message);
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And these print statements were in the console log:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;LOG: undefined 
LOG: esriJobSubmitted 
LOG: undefined 
LOG: esriJobExecuting 
LOG: undefined 
LOG: esriJobSucceeded 
LOG: undefined 
[object Error] 
[object Error] &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the jobID appears to always be undefined. Also, I believe my error function is correct but I'm not sure.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:18:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589180#M55058</guid>
      <dc:creator>ChadHawkins</dc:creator>
      <dc:date>2021-12-12T01:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589181#M55059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the documentation the property is jobId not jobID - JS is case-sensitive so this explains the undefined on some of those lines &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to look at the traffic?&amp;nbsp; IE9 has a Network tab in the developer tools, just remember to click start before submitting the task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also are you able to put a breakpoint in your code, IE should break on a debugger statement provided you haven't got debugged disabled in your Internet Options&amp;gt;Advanced settings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just a hunch...I wonder if trying to access an undefined property (due to incorrect case) in your completeCallback causes an error to bubble/overwrite the actual callback arguments etc. would have to run through the source to check...which I don't have time to do!&amp;nbsp; (let's see what happens when you've corrected the property name, I bet it's this simple)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 12:29:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589181#M55059</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2012-09-14T12:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589182#M55060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;According to the documentation the property is jobId not jobID - JS is case-sensitive so this explains the undefined on some of those lines &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;D'oh! It was staring right at me and I managed to overlook it, I guess that happens when you stare at something for too long. That did the trick, I will work on debugging the [object Error] at the end.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Correcting the property did not affect the [object Error]. I have attached the network log resulting from the job submittal in case that offers any insights.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 13:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589182#M55060</guid>
      <dc:creator>ChadHawkins</dc:creator>
      <dc:date>2012-09-14T13:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589183#M55061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;D'oh! It was staring right at me and I managed to overlook it&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Me too! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I have attached the network log resulting from the job submittal in case that offers any insights.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It's the response content that would probably yield more answers - select the entry of interest (probably the last one) and then go to the "Detail View" - either double-click the entry or click the button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd still go for whacking a breakpoint in your code anyway, literally:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function completeCallback(jobInfo){
&amp;nbsp;&amp;nbsp;&amp;nbsp; debugger; //Poor man's breakpoint ;-)
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:18:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589183#M55061</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2021-12-12T01:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589184#M55062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured out the issue. In the completeCallback function I had "jobinfo" instead of "jobInfo" which was generating the error. I thought I had seen "jobinfo" in some samples, and thus had tried testing first one and then the other capitalization but evidently missed this one when changing around. Thanks Rich for your help, much appreciated!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 13:21:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589184#M55062</guid>
      <dc:creator>ChadHawkins</dc:creator>
      <dc:date>2012-09-14T13:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: jobID returned as undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589185#M55063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I figured out the issue. In the completeCallback function I had "jobinfo" instead of "jobInfo" which was generating the error. I thought I had seen "jobinfo" in some samples, and thus had tried testing first one and then the other capitalization but evidently missed this one when changing around. Thanks Rich for your help, much appreciated!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Double d'oh!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yep, missed that one:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
function completeCallback(jobInfo){
 console.log(jobInfo.jobID);
 console.log(job&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;&lt;STRONG&gt;i&lt;/STRONG&gt;&lt;/SPAN&gt;nfo.jobStatus);
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1 out of 2 - damn, I must be slipping...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/jobid-returned-as-undefined/m-p/589185#M55063</guid>
      <dc:creator>__Rich_</dc:creator>
      <dc:date>2021-12-12T01:18:26Z</dc:date>
    </item>
  </channel>
</rss>

