In this webinar, our experts showcase a variety of demo use cases of how different components of the...
Sometimes you may feel the need to do some CRM clean up. We've already covered one example of this in our blog on How to "Delete" a User in Dynamics CRM. In this blog, we'll focus on why you may want or need to completely remove a field from your CRM database. You might want to do this because:
These are just a few examples that my cause you to say, "Lets clean this up!!"
STEP 1:
Before you begin, always remember to publish ALL Customizations or at least all customizations for the Entities that you will be removing the fields (Attributes).
STEP 2:
BACKUP your customizations and SQL Database – Remember, DELETE is permanent. If you delete a field, you delete all data contained in that field as well. The backup of the customization file is only going to keep a copy of the deleted attributes, NOT the data that is contained in each. The backup of the CRM SQL Database will give you both, but will be a "snapshot" of the database from the point in time the backup is taken.
STEP 3:
Make sure that all fields that you will be removing are NOT on the published form. Example: Fields are not on the Main Form, Navigation Pane, Header area, Footer Area OR in any published View for that entity OR… a related entity. (This is an easy one to forget about. Example: Showing a field from the Account Entity in a Contact View – What type of Account does this Contact work for.)
STEP 4:
Ask yourself one more time "Does this field contain data that I/we will need again in the future?" If your answer is an absolute "NO", then proceed. If you cannot answer this question with an Absolute "NO", then you still have a few options:
STEP 5:
Delete the field(s). In the Configuration Area in the fields list for the Entity, you will notice that you can select a field (Attribute) or multiple Fields using the checkboxes to the left of the fields.
Selecting Fields for deletion, then clicking the "X" button, will prompt you to confirm the deletion.
Clicking "OK" completes the deletion process.
If you accidentally try to remove a field that is still on a Published form, you will receive a message similar to this:
By clicking the blue "Details" hyperlink in the dialog box above, you will be able to easily see why the field could not be deleted.
The items in the screenshot above will need to be corrected before the field can be deleted.
If you are trying to delete more than one field at a time, and one or more of the selected fields cannot be deleted, you will receive an error like this:
All selected Fields that COULD be deleted, will be, but all fields that were still required by the entity will remain behind. You will need to access each remaining field individually to determine why it could not be deleted.
So there's your clean-up tip of the day on deleting attributes from CRM 2011!
Happy CRM'ing!
Dear Jeo.
Can we delete custom field which is import as part of managed solution. i tried the steps as described by you, below error is logged.
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E929CA2CDetail:
-2147220970
System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #E929CA2C
2013-07-03T15:41:17.1681956Z
-2147160014
The 'Delete' operation on the current component(name='Attribute', id='004967a1-eb24-4087-803c-065b2a5c98cb') failed during managed property evaluation of condition: 'Microsoft.Crm.BusinessEntities.IsComponentDeletionEnabledCondition'
2013-07-03T15:41:17.1681956Z
Hello Jeo,
I want to delete some attributes from Contact entity but I receive an error.
For example to delete "ManagerName" or "Anniversary" (I tested several attributes), I receive the following error :
Cannot delete attribute: anniversary from Entity: Contact since the attribute is not a custom field
Thanks in advance
This was SO helpful. I couldn't figure out where to find custom fields to delete them and your images above explained where to go. Thank you so much!