function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Frantz  CarionFrantz Carion 

Use Account Id as Match Key in Bulk API Update

Is it possible to use the Account.Id (or the primary key (=Id) field of the updated table in general) as the match key when running an update via the bulk API?

If yes, how to do so since the tests i've done with a simple CSV file with 2 columns failed (header looked like this: Id,Name)
The status message on the batch entry shows : "InvalidBatch:  Field name not found : Id"
As if it could not find the Id column in Salesforce's Account table.

Please advise
KaranrajKaranraj
Hi Frantz - Yes it is possible. Can you cross verify you have mapped the Id cloumn in the data loader? Hope you have choosen update operation in the data loader
Deepak Kumar ShyoranDeepak Kumar Shyoran
Try with RecordId instead of Id or try with external id field.
This link will help to implement external id http://salesforce.stackexchange.com/questions/15160/bulk-api-foreign-key-resolution-on-lookup-fields.

Frantz  CarionFrantz Carion
Hi Karanrag, I've not created any mapping so far. Since i'm creating the CSV file with fieldnames from the salesforce database, i understood it was not necessary to create a mapping spec file.
Remember i'm trying to import the CSV through the bulk API, via our own application and not via the data loader. However, maybe the same concepts apply to both ways.

When checking on the web interface of the job, i can see it shows the external id field used to match on (although empty in this case), for when running upsert, but for update only i can not see something equivalent to map on an existing field ie: Account.Id in my case.

Basically, and i couldn't understand that from the various examples and code-samples i found, i would just need to know how to define the field in the CSV file to be used to match on
Frantz  CarionFrantz Carion
As advised, i've just tried with RecordId instead of Id, but a similar error occured: Field Name not found: RecordId.

I can not use an external id here, the only link i have available to the salesforce data is the salesforce record Id, and therefore i would need to match on this to run the update.
Frantz  CarionFrantz Carion
Based on this page:
                        
   
https://www.salesforce.com/us/developer/docs/api_asynch/
The actual name of the Id field on Account is AccountNumber. I've therefore tried with this in the CSV headers, again with no success, still a similar error message: Field Name Not Found: AccountNumber
Cosmin PugnaCosmin Pugna
Try yse AccountId prop there instead of Account.Id