• nabhan karmi
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I had a trigger that fired from webhook, this trigger receive JSON that contain external Id for account object, inside the trigger I do an upsert on account object using the following code
Database.upsert(accountrecord, external_id__c)


but sometimes for unknown reason I got the following exception
System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: External_Id__c duplicates value on record with id: 0011x00000Gc4LI: []


I tried to add SOQL query to retrieve the account record with the external Id I have to testing purpose and I didn't get any records!
I built VisualForce page with form to Insert and update account records, it works like a charm, but when I checked account object permission for guest profile, I found there's no read nor create permission, and I still able to create and update account records, I noticed this issue in winter 19 release.
I had a trigger that fired from webhook, this trigger receive JSON that contain external Id for account object, inside the trigger I do an upsert on account object using the following code
Database.upsert(accountrecord, external_id__c)


but sometimes for unknown reason I got the following exception
System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: External_Id__c duplicates value on record with id: 0011x00000Gc4LI: []


I tried to add SOQL query to retrieve the account record with the external Id I have to testing purpose and I didn't get any records!