Hi everyone,
I'm tring to set emailaddress1 as key in my Contact entity.
Previously I check and clean the column and there are no duplicate data.
I can't understand why, setting this field as key, the system job doesn't work.
On log I can see this error:
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.ContactBase' and the index name 'ndx_for_entitykey_new_KEY_emailaddress1'. The duplicate key value is <redacted>.
AND
System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Sql error: Generic SQL error. CRM ErrorCode: -2147204784 Sql ErrorCode: -2146232060 Sql Number: 1505 (Fault Detail is equal to Exception details:
ErrorCode: 0x80044150
Message: Sql error: Generic SQL error. CRM ErrorCode: -2147204784 Sql ErrorCode: -2146232060 Sql Number: 1505
TimeStamp: 2023-05-11T16:11:08.9014027Z
--
Exception details:
ErrorCode: 0x80040216
Message: Exception output:: System.Data.SqlClient.SqlException (0x80131904): The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.ContactBase' and the index name 'ndx_for_entitykey_new_KEY_emailaddress1'. The duplicate key value is <redacted>.
at Microsoft.Crm.CrmDbConnection.HandleExecutionExceptionAbstract(Exception exception, String commandText, IDbConnection connection, IDbCommand command, IDbTransaction transaction, Boolean isOpen, Int32 commandTimeout, IConnectionRetryPolicy localRetryPolicy, Int32& retryCount)
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetryAbstract[TResult](Func`1 executeMethod, IDbCommand command, IConnectionRetryPolicy retryPolicy)
at Microsoft.Crm.CrmDbConnection.<>c_...).
Can anyone help me?
Thanks in advance
S.I.

Report
All responses (
Answers (