Checking the Status of an Asynchronous Job
To check the status of an asynchronous SOAP web services job, you use the checkAsyncStatus operation. When you use this operation, you reference a job Id. In response, the system returns the job’s status, among other details.
Specific status values that can be returned include the following:
-
failed
-
finishedWithErrors — indicates that at least one record was processed, but at least one failed.
-
pending
-
processing
-
finished
If the status is failed, finishedWithErrors, or finished, you can in most cases use the getAsyncResult operation to obtain more details. These details may include the record results, or error and fault messages. The getAsyncResult operation is described in Checking for Detailed Results of an Asynchronous Job.
checkAsyncStatus also returns details about the percentage of the job that is complete, and the estimated time remaining. The estimated remaining time is measured in seconds.
checkAsyncStatus Request and Response
The following is a typical checkAsyncStatus request.
<soap:Body>
<platformMsgs:checkAsyncStatus>
<platformMsgs:jobId>ASYNCWEBSERVICES_563214_053120061943428686160042948_4bee0685
</platformMsgs:jobId>
</platformMsgs:checkAsyncStatus>
</soap:Body>=
The following is a typical checkAsyncStatus response.
<soapenv:Body>
<checkAsyncStatusResponse
xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<asyncStatusResult xmlns="urn:core_2017_1.platform.webservices.netsuite.com">
<jobId>ASYNCWEBSERVICES_563214_053120061943428686160042948_4bee0685</jobId>
<status>pending</status>
<percentCompleted>0.0</percentCompleted>
<estRemainingDuration>0.0</estRemainingDuration>
</asyncStatusResult>
</checkAsyncStatusResponse>
</soapenv:Body>
checkAsyncStatus Faults
The checkAsyncStatus operation can throw any of the following faults:
-
InvalidSessionFault
-
AsyncFault
-
UnexpectedErrorFault
For more information on faults, see SOAP Fault Status Codes.