We have a custom entity that is no longer in use and would like to delete it. We have performed the following steps including exporting the data in case the user needs it. However I can not delete the entity after all the below steps have been completed. Any assistance would be appreciated.
1. Remove ENTITY Navigation from all Forms .
2. Delete ENTITY records
3. Remove busines required from fields
4. Delete all fields from the form except name.
5. Delete business rule
6. Delete custom view
7. Change all remaining views to name only.
8. Remove Custom Mappings
9. Remove Custom Relationships
12. Remove ENTITY from all menus and deselect any options.
13. Delete all Custom Fields
14. Delete Javascript ties
15. Remove Security roles from forms.
ERROR in eventviewer: MSCRMPlatform Event ID 24065
Exception information:
Exception type: SoapException
Exception message: System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "solutioncomponent_parent_solutioncomponent". The conflict occurred in database "ORG_MSCRM", table "dbo.SolutionComponentBase", column 'RootSolutionComponentId'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionComponentService.DeleteFromAllSolutions(SolutionComponentMoniker moniker, Boolean skipProtected, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, MetadataHelper metadataHelper, Boolean suppressSecurityCacheFlush, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, Guid solutionId)
at Microsoft.Crm.Application.WebServices.SystemCustomization.EntityDelete.Execute(Guid solutionId, Guid entityId)
at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.DeleteEntity(Guid entityId)
ClientConnectionId:da52e3bd-3d5e-40f7-abe4-b4782d624593
Error Number:547,State:0,Class:16
at Microsoft.Crm.Dialogs.DeleteDialogPage.ConfigureForm()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The DELETE statement conflicted with the SAME TABLE REFERENCE constraint "solutioncomponent_parent_solutioncomponent". The conflict occurred in database "ORG_MSCRM", table "dbo.SolutionComponentBase", column 'RootSolutionComponentId'.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionComponentService.DeleteFromAllSolutions(SolutionComponentMoniker moniker, Boolean skipProtected, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, MetadataHelper metadataHelper, Boolean suppressSecurityCacheFlush, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, Guid solutionId)
at Microsoft.Crm.Application.WebServices.SystemCustomization.EntityDelete.Execute(Guid solutionId, Guid entityId)
at Microsoft.Crm.Application.WebServices.SystemCustomization.SystemCustomization.DeleteEntity(Guid entityId)