1

My company is loading 3rd-party data into SalesForce using the BulkAPI (Python). This data is loaded into 3 SalesForce objects: Account, Contact, and Opportunity using 'upsert' method with Account External ID based on incoming data.

The problem comes with associating Contact and Opportunity object to Account object. The API call returns an ID similar to 0016A00000ACjUv (AccountId), which presumably I should use as unique identifier for Contact and Opportunity (using field name ID). However, this returns error:

"INVALID_ID_FIELD:'0016A00000ACjUv' is not a valid Salesforce ID for the type Contact"

I've tried number of variations and all of them have fail.

job = bulk.create_upsert_job('Contact', 'Id', contentType='CSV', concurrency='Parallel')

And

job = bulk.create_upsert_job('Contact', 'AccountId', contentType='CSV', concurrency='Parallel')

Has anyone experienced this and what solution would you recommend?

0

Any ID starting with the 001 keyprefix is for Account.

The error message:

"INVALID_ID_FIELD:'0016A00000ACjUv' is not a valid Salesforce ID for the type Contact"

Suggests the code is trying to use the ID of an Account as the ID for a Contact.

I suspect you have put the Account ID into the wrong field on the Contact record. That value should go into the Contact.AccountID field to relate it back to the parent Account.

See also:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.