Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Components cannot be removed from unmanaged solution

Posted on by 437

Hello Folks,

We have a unmanaged  solution in our DEV environment. I've added few entities in that solution (Account,Contact,Lead,User and a custom entity ) . We have created patches of this solution  and then cloned it with newer version. 

Somehow, all the assets are added into solution for given entities but we need to deploy only specific components of it. Hence we are trying to remove it from solution and add it again with specific list of components.

But while removing (not deleting ) Lead,Contact or Account we are facing below error ,

Removal-Error.PNG

User and custom entity is successfully removed from the solution. 

Note : I'm not deleting entity , I'm just removing it from Un-managed solution 

 

Below is the error details---


Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: The object you tried to delete is associated with another object and cannot be deleted.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>e386a93f-b72f-49d4-8c71-e6a72ce4f1a4</ActivityId>
<ErrorCode>-2147220953</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<d2p1:key>ApiExceptionSourceKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.ObjectModel.SolutionComponentService</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiOriginalExceptionKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmException: The object you tried to delete is associated with another object and cannot be deleted. ---&gt; Microsoft.Crm.CrmException: The object you tried to delete is associated with another object and cannot be deleted.
at Microsoft.Crm.BusinessEntities.CrmCascadeDBHandler.&lt;&gt;c__DisplayClass8_1.&lt;CollectForCascadeWrapper&gt;b__1(IDbCommand cmd)
at Microsoft.Crm.BusinessEntities.CrmCascadeDBHandler.&lt;&gt;c__DisplayClass12_0.&lt;Collect&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.BusinessEntities.CrmCascadeDBHandler.&lt;&gt;c__DisplayClass8_0.&lt;CollectForCascadeWrapper&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.BusinessEntities.CrmCascadeDBHandler.CollectForDelete(IEnumerable`1 entityIds, Int32 entityOtc, ExecutionContext context, Boolean evaluateAsyncMode)
at Microsoft.Crm.BusinessEntities.CascadeEngine.&lt;&gt;c__DisplayClass9_0.&lt;CascadeDeleteDB&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.BusinessEntities.CascadeEngine.&lt;&gt;c__DisplayClass62_0.&lt;Delete&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.&lt;&gt;c__DisplayClass203_0.&lt;Delete&gt;b__0()
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
at Microsoft.Crm.ObjectModel.SolutionComponentService.RemoveSolutionComponent(Guid componentId, Int32 componentType, String solutionUniqueName, ExecutionContext context, Boolean validateSolution)
at Microsoft.Crm.ObjectModel.SolutionComponentService.RemoveSolutionComponent(Guid componentId, Int32 componentType, String solutionUniqueName, ExecutionContext context)
--- End of inner exception stack trace ---
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.Pipeline.&lt;&gt;c__DisplayClass2_1.&lt;Execute&gt;b__0()</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">0a59e1ba-3f13-11dd-9bde-0019b9312238</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiDepthKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">1</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiActivityIdKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">e386a93f-b72f-49d4-8c71-e6a72ce4f1a4</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiPluginSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>ApiStepSolutionNameKey</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">System</d2p1:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<d2p1:key>0</d2p1:key>
<d2p1:value xmlns:d4p1="www.w3.org/.../XMLSchema" i:type="d4p1:string">Deleting records from SolutionComponent (ObjectTypeCode: 7103)
for Id(s) : d0374273-e32a-e911-a980-000d3ab9aac9
Exception : Cascade Delete failed due to cascade restrict relation. Details below :
Restricting entity SolutionComponent (ObjectTypeCode: 7103) has 2 referencing record(s).
</d2p1:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>The object you tried to delete is associated with another object and cannot be deleted.</Message>
<Timestamp>2019-06-20T13:15:00.8999236Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

 

  • Ashish - CS Profile Picture
    Ashish - CS 15 on at
    RE: Components cannot be removed from unmanaged solution

    Hi Prashant, I am facing the same issue. Did you find any resolution for this?

    Many thanks,

    Ashish

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Components cannot be removed from unmanaged solution

    Hi partner,

    I tried to put the three entities into a new unmanaged solution and then remove them one by one, and I could do this successfully.

    So there is any other entity or compoments in your solution?

    Best Regards,

    Leo

  • Prashant Wani Profile Picture
    Prashant Wani 437 on at
    RE: Components cannot be removed from unmanaged solution

    Hi Leo,

    Thanks for your reply. I've already gone through the post shared by you. I've tried all the orders to remove these entities from the solution but cannot remove it.

    However I couldn't delete those relationships from system as we are using them .if I delete them I will loose data with it.

    Any other way please?

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Components cannot be removed from unmanaged solution

    Hi partner,

    The error message told us that the lead entity is associated with other eneities (account&contact) so that we could remove or delete it directly.

    When you going to Settings->Customizations->Customize the system->Lead->1:Nrelationship, you could see the dependency between Lead and Contact&Account.

    This is the reason why you could not remove Lead in your solution.

    4278.community12.png

    You could try to change your remove order, for example, account first, then contact and finally lead.

    If the issue still exists, please kindly share us more detail about your solultion like screenshots of compoments.

    You could also refer to the following posts.

    https://social.microsoft.com/Forums/en-US/2bfa8ff1-3c78-4d46-b77b-861515e6e7f3/quotthe-object-you-tried-to-delete-is-associated-with-another-object-cant-be-deletedquot?forum=crm

    Hope it helps.

    Best Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans