Quantcast
Channel: Forum CRM Deployment
Viewing all articles
Browse latest Browse all 997

Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object.

$
0
0

Hi,

I have a custom entity "TT" which has N:1 relationship with Account (Relationship Behavior - Delete: Cascade All) & N:N relationship with Contact.

When you create an account record "A1" with a primary contact "C1" and primary contact associated to "A1". Also, create a "T1" record (TT entity) that has C1 contact in the sub grid. I am NOT able to delete the Account record when I have contact sub grid populated. If Sub grid is not populated, I have no problem deleting the Account record.

I get "Generic SQl Error" error message. I ran the Profiler and found the following error. 

Violation of PRIMARY KEY constraint 'PK__fn_Colle__6056C81940339838'. Cannot insert duplicate key in object 'dbo.@t'. The duplicate key value is (10046, 13bd5815-074b-e311-b4f6-782bcb6d0c4e, 2).
  
We are on UR 14. Any suggestions or recommendation to resolve this issue?

Thanks!



Viewing all articles
Browse latest Browse all 997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>