14 votes
Accepted

Bulk API Error: UNABLE_TO_LOCK_ROW:unable to obtain exclusive access to this record or 124 records

A great resource for understanding row locking situations is the Record Locking Cheat Sheet (PDF link). Note at the top of page 2 that insert, update, and delete of Opportunities locks the parent ...
David Reed's user avatar
  • 92.6k
11 votes
Accepted

NUMBER_OUTSIDE_VALID_RANGE: value outside of valid range on numeric field: 100.0

Precision is the total number of digits allowed both left and right of the decimal, and scale is the number of digits to the right of the decimal. The number of digits just to the left of the decimal ...
sfdcfox's user avatar
  • 487k
10 votes
Accepted

Is there a *public-facing* list of GACK codes?

I work for Salesforce on the Apex product team, but this is mostly personal opinion and not an official stance. is there a GACK ID to Metadata Type list for issues around the Metadata/Tooling/Bulk ...
ca_peterson's user avatar
  • 22.9k
9 votes
Accepted

Uploading 100,000 binary files as attachments to Case record - best approach

I would suggest you to go with data loader using SOAP API, which is by default (not Bulk API). Why? You do not need to write any code to use Data loader It is tested solution, so no bugs With ...
AtulRajguru9's user avatar
  • 9,110
9 votes

bulk api text/csv CRLF error

change the Request body of Job Creation as follows. { "operation" : "insert", "object" : "Product2", "contentType" : "CSV", "lineEnding" : "LF" } It worked for me.Also ensure that the ...
kiran Nath's user avatar
8 votes

Is there a *public-facing* list of GACK codes?

The GACK ID values are derived heuristically, and are only meant for grouping crashes with the same root cause together, in order to define the frequency of the crash. It is up to a human to read the ...
sfdcfox's user avatar
  • 487k
7 votes
Accepted

A Few API Related Doubts

The bulk API is ideally for much larger than 1500 records. Like you state, in cases where there are 100k of records a typical use of the SOAP API would quickly begin to eat away at the daily API ...
pchittum's user avatar
  • 19.6k
7 votes
Accepted

How to retrieve compound fields like address using Bulk API?

There is a clue in this help page on compound fields: Compound fields can't be included in Bulk queries. Use the individual field components to access or update field values. It turns out that you ...
metadaddy's user avatar
  • 16.4k
7 votes
Accepted

FIELD_CUSTOM_VALIDATION_EXCEPTION happens without upserting the field

FIELD_CUSTOM_VALIDATION_EXCEPTION means that there is a validation rule defined in your org and the record you are updating does not meet this rule. When you update a record the entire record is ...
gNerb's user avatar
  • 9,471
6 votes
Accepted

What is the maximum time limit whithin which we can add batches to the Bulk data load using Bulk API

The Bulk API Limits states: You can submit up to 5,000 batches per rolling 24 hour period. You can't create new batches associated with a job that is more than 24 hours old. Additionally, the job ...
sfdcfox's user avatar
  • 487k
6 votes
Accepted

Bulk Data Load jobs very slow; what's holding up the queue?

The Bulk API operates like other asynchronous features, such as the Metadata API, Batchable classes, Sandbox refreshes, and so on. It goes in to a queue and is processed as resources allow. If you ...
sfdcfox's user avatar
  • 487k
6 votes

large bulk insert/delete using jsforce

Looks like that number is an intentional API Limit. From the Bulk API Documentation: Batch size Batches for data loads can consist of a single CSV, XML, or JSON file that is no larger ...
battery.cord's user avatar
  • 8,815
6 votes

Does Salesforce Bulk API 2.0 accept JSON as the contentType?

Looking at the Bulk API 2.0 documentation, it does not support any other contentType except for CSV. Below is the excerpt from the documentation: The content type for the job. The only valid value (...
Jayant Das's user avatar
  • 30.4k
6 votes
Accepted

Setting the batch size via Bulk API

The Bulk API is intended to load large numbers of records in parallel asynchronously. It also has really small daily limits. You could technically set up 10,000 batches of 1 record each, but then you'...
sfdcfox's user avatar
  • 487k
6 votes
Accepted

REST api to upload multiple notes and attachments at once

Yes, there are a few ways to upload files. You can use the API you referenced in your question (the "create new records" API), and you can also upload using a multipart upload. For the first ...
sfdcfox's user avatar
  • 487k
6 votes
Accepted

How can I monitor the bulk API limit?

Call the Limits API with a GET request: GET /services/data/v45.0/limits Your response map will include "DailyBulkApiRequests" : { "Max" : 10000, "Remaining" : 10000, } as well as a ...
David Reed's user avatar
  • 92.6k
6 votes
Accepted

Will Bulk API be affected by System.isBatch()?

No, it won't. Processing of records in a Bulk API job is not treated as an Asynchronous Apex context. The System.isBatch() method Returns true if a batch Apex job invoked the executing code, or ...
David Reed's user avatar
  • 92.6k
6 votes
Accepted

Bulk API Upserting Datetime fields - Time is Off By Inconsistent Number of Minutes

It's those microseconds in your datetime: .920634. The Salesforce API generally accepts milliseconds (.123) in ISO8601 date times, although they also sometimes get truncated on insert to .000. What ...
David Reed's user avatar
  • 92.6k
5 votes

Can't I use ALL ROWS in asynchronous Salesforce queries?

It sounds like there was a discussion with someone in Salesforce that the Bulk API wasn't the right tool for monitoring deleted records. There is always the Data Export functionality. It's kind of ...
Daniel Ballinger's user avatar
5 votes
Accepted

Specify large set of IDs in SOQL query

Edit: The new SOQL limit is 100,000 characters, but you only get 4,000 characters for the where clause in the new limits. You'll definitely want to use the retrieve call (now available in REST) to get ...
sfdcfox's user avatar
  • 487k
5 votes
Accepted

Error desearlizing JSON of type BatchInfo - Bulk API

You don't quite have the right structure. You need an outer wrapper as well. public class BulkApiResponse { public List<BatchInfo> batchInfo; } Now you can deserialize the structure: ...
Adrian Larson's user avatar
  • 150k
4 votes

Will Trigger and Workflow get fired while using Bulk API

Triggers and Workflows will fire irrespective of the API you are using. Form the link that you have shared please go to the section: Triggers Although the flexibility of triggers is a great asset, ...
C0DEPirate's user avatar
  • 1,599
4 votes
Accepted

How to check records source in Trigger?

I suggest that you create a specific User for this bulk load process that is not used for any other purpose. Then your trigger can base its conditional logic on that: if (UserInfo.getUserName() == '...
Keith C's user avatar
  • 136k
4 votes

Why I can't change OwnerId to null or empty?

All Records in Salesforce must have an Owner which is either a User or a Queue, if you try and set OwnerId to Null or blank "", this will always fail as the field is mandatory therefore Null is not an ...
Dave Humm's user avatar
  • 5,091
4 votes
Accepted

Bulk-API insert with sObject Tree

The sObject tree is only for the REST API, not the Bulk API. While they both use a REST-ful nature, only the REST API supports the sObject tree. This generally means you have to upload records in ...
sfdcfox's user avatar
  • 487k
4 votes
Accepted

Facing record lock issue on Parent when loading millions records

Your suggestions are all valid in there own right, but they do become dependent on your data. I would lean towards #3 the most, as that is what I most often do (because it works with most of my data ...
Jesse Milburn's user avatar
4 votes

Any good way to estimate bulk api processing time?

PK Chunking is always a good option when you know you're going to be dealing with lots (100k - Millions) of records. https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/...
Brand0R's user avatar
  • 1,044
4 votes
Accepted

Prevent duplicates: Trigger - Workflow Field Update- Trigger w/ Callout - AllOrNone = false

Recent conversation on another question prompted me to take a look into this. The documentation has changed since this question was originally asked, but a key observation here is that when allOrNone ...
Derek F's user avatar
  • 60.9k
4 votes

Salesforce Bulk API Unable to lock row

This error is not about the batchsize which you are thinking of. This is occurring in the parallel mode when API tries to lock the parent record or any record in the relationship at the time of ...
Santanu Boral's user avatar
4 votes

Bulk API 2.0 Upload for files bigger than 150Mb

After some tests I discovered that the API don't support more than one file per job. It fails if more than one file tries to be uploaded. So I had to split my big file and create a job for each of ...
Dan's user avatar
  • 61

Only top scored, non community-wiki answers of a minimum length are eligible