JobInfo

A job contains one or more batches of data for you to submit to Salesforce for processing. When a job is created, Salesforce sets the job state to Open.

You can create a new job, get information about a job, close a job, or abort a job using the JobInfo resource.

Fields

Name Type Request Description
apiVersion string Read only. Do not set for new job. The API version of the job set in the URI when the job was created. The earliest supported version is 17.0.
apexProcessingTime long Do not specify for new job. The number of milliseconds taken to process triggers and other processes related to the job data. This is the sum of the equivalent times in all batches in the job. This doesn't include the time used for processing asynchronous and batch Apex operations. If there are no triggers, the value is 0. See also apiActiveProcessingTime and totalProcessingTime.

This field is available in API version 19.0 and later.

apiActiveProcessingTime long Do not specify for new job. The number of milliseconds taken to actively process the job and includes apexProcessingTime, but doesn't include the time the job waited in the queue to be processed or the time required for serialization and deserialization. This is the sum of the equivalent times in all batches in the job. See also apexProcessingTime and totalProcessingTime.

This field is available in API version 19.0 and later.

assignmentRuleId string Can't update after creation. The ID of a specific assignment rule to run for a case or a lead. The assignment rule can be active or inactive. The ID can be retrieved by using the SOAP-based SOAP API to query the AssignmentRule object.
concurrencyMode ConcurrencyModeEnum The concurrency mode for the job. The valid values are:
  • Parallel: Process batches in parallel mode. This is the default value.
  • Serial: Process batches in serial mode. Processing in parallel can cause database contention. When this is severe, the job may fail. If you're experiencing this issue, submit the job with serial concurrency mode. This guarantees that batches are processed one at a time. Note that using this option may significantly increase the processing time for a job.
contentType ContentType The content type for the job. The valid values are:
  • CSV—data in CSV format
  • XML—data in XML format (default option)
  • ZIP_CSV—data in CSV format in a zip file containing binary attachments
  • ZIP_XML—data in XML format in a zip file containing binary attachments
createdById string System field The ID of the user who created this job. All batches must be created by this same user.
createdDate dateTime System field The date and time in the UTC time zone when the job was created.
externalIdFieldName string Required with upsert The name of the external ID field for an upsert().
id string Do not specify for new job. Unique ID for this job.

All GET operations return this value in results.

numberBatchesCompleted int Do not specify for new job. The number of batches that have been completed for this job.
numberBatchesQueued int Do not specify for new job. The number of batches queued for this job.
numberBatchesFailed int Do not specify for new job. The number of batches that have failed for this job.
numberBatchesInProgress int Do not specify for new job. The number of batches that are in progress for this job.
numberBatchesTotal int Do not specify for new job. The number of total batches currently in the job. This value increases as more batches are added to the job. When the jobstate is Closed or Failed, this number represents the final total.

The job is complete when numberBatchesTotal equals the sum of numberBatchesCompleted and numberBatchesFailed.

numberRecordsFailed int Do not specify for new job. The number of records that were not processed successfully in this job.

This field is available in API version 19.0 and later.

numberRecordsProcessed int Do not specify for new job. The number of records already processed. This number increases as more batches are processed.
numberRetries int The number of times that Salesforce attempted to save the results of an operation. The repeated attempts are due to a problem, such as a lock contention.
object string Required The object type for the data being processed. All data in a job must be of a single object type.
operation OperationEnum Required The processing operation for all the batches in the job. The valid values are:
  • delete
  • insert
  • query
  • upsert
  • update
  • hardDelete
Warning
The operation value must be all lower case. For example, you get an error if you use INSERT instead of insert.

To ensure referential integrity, the delete operation supports cascading deletions. If you delete a parent record, you delete its children automatically, as long as each child record can be deleted. For example, if you delete a Case record, the Bulk API automatically deletes any child records, such as CaseComment, CaseHistory, and CaseSolution records associated with that case. However, if a CaseComment is not deletable or is currently being used, then the delete operation on the parent Case record fails.

Warning
When the hardDelete value is specified, the deleted records aren't stored in the Recycle Bin. Instead, they become immediately eligible for deletion. The permission for this operation, “Bulk API Hard Delete,” is disabled by default and must be enabled by an administrator. A Salesforce user license is required for hard delete.
state JobStateEnum Required if creating, closing, or aborting a job. The current state of processing for the job:
  • Open: The job has been created, and batches can be added to the job.
  • Closed: No new batches can be added to this job. Batches associated with the job may be processed after a job is closed. You cannot edit or save a closed job.
  • Aborted: The job has been aborted. You can abort a job if you created it or if you have the “Manage Data Integrations” permission.
  • Failed: The job has failed. Batches that were successfully processed can't be rolled back. The BatchInfoList contains a list of all batches for the job. From the results of BatchInfoList, results can be retrieved for completed batches. The results indicate which records have been processed. The numberRecordsFailed field contains the number of records that were not processed successfully.
systemModstamp dateTime System field Date and time in the UTC time zone when the job finished.
totalProcessingTime long Do not specify for new job. The number of milliseconds taken to process the job. This is the sum of the total processing times for all batches in the job. See also apexProcessingTime and apiActiveProcessingTime.

This field is available in API version 19.0 and later.

© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.