Questions tagged [upsert]

All queries related to Upsert can be grouped under this Tag

Filter by
Sorted by
Tagged with
10
votes
2answers
14k views

Database.upsert - how to find which records have inserted/updated based on ExternalId

I am upserting list of records based on externalId as follows: List<Database.upsertResult> results = Database.upsert(lstRecords, CustomObject__c.External_Id__c,true); The results returns as ...
12
votes
6answers
19k views

Why does upsert cause a DUPLICATE_VALUE error?

I have a custom object, with a Text Name (ID) field. When I upsert two records with identical Name/ID, but otherwise different values, in two separate upsert statement, one record results, as expected....
9
votes
1answer
735 views

Is upsert properly ACID compliant?

Given an object Table_A with one unique field Unique and two rows: row Unique --- ------ 1 A 2 B And the following class: public class KeySwapDML { public void ...
4
votes
2answers
3k views

Can I upsert PricebookEntry Records?

Is it possible to upsert PBE records? According to the API document, upsert is a supported function. Now that we can create custom fields on the PBE, I even added an external ID field, but I cannot ...
9
votes
3answers
4k views

Is it possible to Upsert a List<SObject> with external ID specified

I'm getting an error when attempting to compile my Apex: Upsert requires a concrete SObject type In my code, I'm unable to create a concrete declaration for the container which I want to upsert. ...
3
votes
1answer
2k views

Upserting Data using Data Loader with External ID

I'm using Data Loader in order to Upsert some data within my Org. I know, that if I will Upsert a record within my CSV that has duplicate External Id value with another record in the file, It will ...
2
votes
1answer
4k views

Error: Accounts: Cannot specify any additional fields when marrying or separating a Person-Account

I'm using an ETL tool Talend for data push to salesforce. When I'm upserting the accounts getting the error below In the mapping I specified the business accounts recordtypeId but still is throwing ...
1
vote
1answer
464 views

Upsert in managed package fails with DUPLICATE_VALUE - Is custom WF rule root cause?

One can read about sporadic DUPLICATE_VALUE errors during Upsert in many forums. They mostly occur in Dataloader scenarios with a root cause being Oracle race conditions. But what I have here is not ...
0
votes
1answer
860 views

Upserting campaign members for campaigns

I have an apex class that creates campaigns based on mailings and then is supposed to add campaign members to the campaigns that were just created. The last step is done essentially by creating new ...