Select to view content in your preferred language

Issue Deleting/Cancelling Job Request

753
1
08-23-2022 11:59 PM
utility9213
Emerging Contributor

Good Day Everyone, I am facing issues in canceling/deleting a job request. I have a tool to download a specific portion of the layer on the map.

So in the midst of processing the layer for download,  a cancel button will appear. This button is used to cancel the job, however, I cannot find the solution to cancel this job.

I am currently using ArcGIS Api 3.4.1. Please do let me know if there is any other solutions to this. Thank you

I have tried the following:

let cancelURL = URL+"/"+jobId+"/delete" 

esriRequest({
              url: cancelURL,
              content: {
                f: 'json'
              },
              handleAs: "json",
              callbackParamName: 'callback'
            }).then((test)=>{console.log(test)}) 
0 Kudos
1 Reply
Noah-Sager
Esri Regular Contributor

Hi @utility9213, so you are working with version 3.41, and want to be able to cancel a request? If you're using a geoprocessing class, there are methods already available to cancel jobs: https://developers.arcgis.com/javascript/3/jsapi/geoprocessor-amd.html#methods

If not, I would need to see more of your code to help troubleshoot.

0 Kudos