web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unable to delete custom entity

(0) ShareShare
ReportReport
Posted on by

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)

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Unable to delete custom entity

    We ended up having a custom ribbon button that was holding this up. Once we removed the button then we were able to fully delete the entity.

  • DBuchanan Profile Picture
    on at
    RE: Unable to delete custom entity

    I'm having a similar issue when trying to remove a customer entity. 

    The dependencies are relationships and the system will not allow me to delete these relationships in order to remove the entity itself.

    How do I remove the dependent relationships for the entity?

    Thank you

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Unable to delete custom entity

    Thank you removing this entity from older solutions allowed me to delete the entity.

  • Verified answer
    prt33k Profile Picture
    6,907 on at
    RE: Unable to delete custom entity

    Hi Jennifer,

    As per the error message, there seems to be a conflict in solutions. Are there multiple solution of which this particular entity is a part of?

    If all the relationship are removed then do try removing (not deleting) this entity from multiple solutions.

    Also can you also provide CRM trace logs?

  • Suggested answer
    M I Mostafa Profile Picture
    4,257 on at
    RE: Unable to delete custom entity

    I would suggest that you focus on number 9 in your actions. This is where most dependencies lie.

    Try to add the custome entity to a solution and export the solution. In latest CRM version you will get a warning telling you what other dependencies this entity has. Usually dependencies can be hidden in views, forms charts or even calculated fields depending on your version of Dynamics CRM.

    Try these options and let us know if you fix it please.

    Thanks

    Mohamed

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#2
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans