0

I have an external Id field called Unique_Identifier__c which is a concatenation of two fields on this Custom SObject Recipient. This field is created/populated at before insert.

I want to allow the user to update records and I do not want to create duplicates in the system. I am upserting a list of these Custom SObjects at before insert after looping through all Recipients who have a match between their Unique Identifier and what is in the map.

When I go to upsert it is

  1. updating records that match with the Unique Identifier and
  2. creating duplicates

Why is my upsert creating duplicates if I am giving the External Id to match Recipients on? Should I be doing this in before insert? When replacing upsert with update it is also creating duplicates.

2
  • 2
    Without seeing your code, there's not much we can do to help you. If you're doing it right, no duplicates should be created.
    – sfdcfox
    Commented Oct 8, 2021 at 19:40
  • is it possible for to you copy and paste your code here? Commented Oct 8, 2021 at 20:05

1 Answer 1

0

In order to discard the duplicate values for external field, we need select the "Unique" option which will not allow duplicate values to be stored in system by Treat "ABC" and "abc" as duplicate values (case insensitive).

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .