You need to sign in to do that
Don't have an account?
|System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found:
Hi All,
I am getting an exception
USER_DEBUG [6]|DEBUG|System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []
when I am trying to insert an EntitySubscription record
EntitySubscription en=new EntitySubscription(NetworkId = commId, SubscriberId = sid, ParentId = pid);
try{upsert en;}catch(Exception e){System.debug(e);}
I checked for duplicate records but there are no duplicate i could find in workbench
Thanks
I am getting an exception
USER_DEBUG [6]|DEBUG|System.DmlException: Upsert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []
when I am trying to insert an EntitySubscription record
EntitySubscription en=new EntitySubscription(NetworkId = commId, SubscriberId = sid, ParentId = pid);
try{upsert en;}catch(Exception e){System.debug(e);}
I checked for duplicate records but there are no duplicate i could find in workbench
Thanks
Please check this.
http://danielsokolowski.blogspot.in/2014/08/duplicate-value-found-duplicates-value.html
https://sfdcdev.wordpress.com/2011/07/08/upsert-failed-first-exception-on-row-0-first-error-duplicate_value/
All Answers
Please check this.
http://danielsokolowski.blogspot.in/2014/08/duplicate-value-found-duplicates-value.html
https://sfdcdev.wordpress.com/2011/07/08/upsert-failed-first-exception-on-row-0-first-error-duplicate_value/
Instead of Try