• Ashish Sharma 406
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

when attempting to delete a list of FeedItems I'm getting the following error:

 

EXCEPTION: System.DmlException: Delete failed.

First exception on row 1 with id 0D5G000000h9c6ZKAQ; first error:

DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []

 

As I understand it the DUPLICATE_VALUE error is for then you try an insert/update/upsert and you have a duplicated value in a unique field, I don't understand why is this firing on a DELETE operation.

 

I checked and don't have duplicate FeedItems in the list, I even tried doing:

 

List<FeedItem> fiList = [SELECT Id FROM FeedItem WHERE Id in ('id1', 'id2')];
delete fiList;

 and I'm still getting the same error.

 

I have just one trigger and I alredy tried disabling it and the error still happens.

 

The error doesn't happen always, but I can't find any logic to why is happenning.

 

Any ideas of why this may be happening or how to fix it will be greatly appreciated.

 

Thank you