Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to delete managed fields where iscomponentdeletionenabled is false?

Posted on by 69 User Group Leader

We have some custom fields that are now obsolete and I need to emove. We created these fields but they got included in a managed solution that ended up overwriting our development environment.
There are no dependencies. When I try to delete the fields in the UI, I get an error RE:
The 'Delete' operation on the current component(name='Attribute', id='27b59de5-6d13-43ac-a668-a3b79abefb4b') failed during managed property evaluation of condition: 'Managed Property Name: iscomponentdeletionenabled; Component Name: Attribute; '

I tried the method of creating the Managed Solution and updating the Managed Solution to delete the field components, but they were not removed. Method here.

I cannot find this attribute in the MetadataSchema in the database (to switch false/true?).

Is there a way to find and edit the offending condition in the database or the customizations.xml file to enable deletion of these obsolete fields?

*This post is locked for comments

  • v22arvind Profile Picture
    v22arvind 65 on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    Well, while you'll get the holding/stage-upgrade solution everywhere which is the supported/only recommended way, there are scenarios where you don't even know what other stuff would get deleted since the solution is too large or you have multiple managed solutions having that attribute and so above recommended approach doesn't works.

    I have a on-prem setup and have access to DB and this is just a test environment where some incorrect attribute got created which I just need to delete.

    While I already know what you are doing but I should add - PLEASE DO AT YOUR OWN RISK AND ITS UNSUPPORTED!

    I think the columns which represent 'iscomponentdeletionenabled' property are either 'IsUnmanagedAttribute' or 'IsManaged' or both.

    So I fired an update command to change those:

    update Attribute

    set IsUnmanagedAttribute = 1, IsManaged = 0

    where Name = 'name of attribute' <put additional conditions and ensure that you get only the rows related to your attributes>

    and then I tried deleting the field from 'default solution' - bam! another error but it was little different:

    The 'Delete' operation on the current component(name='OptionSet', id='some guid') failed during managed property evaluation of condition: 'Managed Property Name: iscomponentdeletionenabled; Component Name: OptionSet

    now its complaining about the optionset - because my fields were of type option set. We'll no worries, another update to the optionset table:

    update OptionSet

    set IsManaged = 0

    where Name = 'find your optonset or use id instead from the error above'.

    Tried deleting from the default solution again - voila, the fields are gone!

    Now I need to run the deployment to see if everything is ok or broken :)

  • Suggested answer
    Harsha Asadi Profile Picture
    Harsha Asadi 10 on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    Hi,

    You were able to solve this issue. If yes do let me know the steps.

    As I have exact similar situation.

    Thanks in advance.

  • Suggested answer
    Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    You can try the below:

    1. Take a backup of your DEV environment

    2. Extract your managed solutions

    3. Open the solution.xml solution file in an xml editor

    4. Change the Managed element from 1 to 0

    5. Recompress your files into a .zip file

    6. Import the solution

  • Allie_B Profile Picture
    Allie_B 69 User Group Leader on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    The previous CRM administrator originally created custom solutions in our Development environment, then exported them to our Production environment as Managed solutions.

    At one point a database backup of the Development database with Unmanaged solutions was not saved as requested.

    The Development environment was refreshed from a copy of the Production database (containing Managed solutions), overwriting the Unmanaged customizations.

    Our Previously Unmanaged solutions became Managed.

  • Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    Where did you get this managed solution? Apply the same in the environment of the solution containing those fields

  • Allie_B Profile Picture
    Allie_B 69 User Group Leader on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    Thanks for the reply, Charles. Unfortunately I cannot delete these fields from the dev environment. These custom fields are Managed.

  • Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: How to delete managed fields where iscomponentdeletionenabled is false?

    Hello,

    What I suggest is the following:

    1. Create a new "temp" solution

    2. Add all the components included in the main solution into this temp solution

    3. Delete the obsolete fields from your dev environment

    4. Export the temp solution as managed

    5. Export the main solution as managed

    6. Import the temp solution into your destination organization

    7. Delete the main managed solution from your destination organization (this will not remove your components or data, because all your needed composants are already included in the temp solution)

    8. Re-Import the newly exported main solution into your destination organization

    9. Delete the temp solution from your destination organization

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans