function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kanhaiya Yadav 4Kanhaiya Yadav 4 

Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate record

Hi,
I have written after insert trigger on contact object.
After creating a contact,  I am creating a lead.

I getting an error  "FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate record. We recommend you use an existing record instead.:"

I am not getting this error while creating the same lead manual. 

Thanks In Advance




 
Best Answer chosen by Kanhaiya Yadav 4
Khan AnasKhan Anas (Salesforce Developers) 
Hi Kanhaiya,

Greetings to you!

This validation error is caused by the duplicate management rule. I suggest you to please check If there are any active Duplicate Rules. 

1. Go to Setup.
2. In Quick Find box search Duplicate Rules and select it.
3. Select the rule(s) to deactivate.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Khan AnasKhan Anas (Salesforce Developers) 
Hi Kanhaiya,

Greetings to you!

This validation error is caused by the duplicate management rule. I suggest you to please check If there are any active Duplicate Rules. 

1. Go to Setup.
2. In Quick Find box search Duplicate Rules and select it.
3. Select the rule(s) to deactivate.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer
Kanhaiya Yadav 4Kanhaiya Yadav 4
Thanks. It is working.
Buyan Suvan 1Buyan Suvan 1
Thank you! You saved my day!