Print this page

Spring 15 - Bulk API changes

Knowledge Article Number 000206843

Bulk API includes two new request headers. One lets you specify how AnchorSalesforce reads line endings when you upload data. The other lets you enable automatic primary key (PK) chunking for bulk queries.

Line Ending Header

When you’re creating a bulk upload job, the Line Ending request header lets you specify whether line endings are read as line feeds (LFs) or as carriage returns and line feeds (CRLFs) for fields of type Text Area and Text Area (Long).

The following example specifies that line endings are read as CRLFs: Sforce-Line-Ending: CRLF

PK Chunking Header

Use the PK Chunking request header to enable automatic primary key (PK) chunking for a bulk query. PK chunking splits bulk queries on very large tables into chunks based on the record IDs, or primary keys, of the queried records. Each chunk is processed as a separate batch that counts toward your daily batch limit, and its results must be downloaded separately. PK chunking is supported for the following objects: Account, Campaign, CampaignMember, Case, Contact, Lead, LoginHistory, Opportunity, Task, User, and custom objects.

Salesforce recommends that you enable PK chunking when querying tables with more than 10 million records or when a bulk query consistently times out. However, the effectiveness of PK chunking depends on the specifics of the query and the queried data.

The following example enables PK chunking with a chunk size of 50,000 records:
​Sforce-Enable-PKChunking: chunkSize=50000

promote demote