Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications


Best Practices for Deleting and Bulk Deleting Attributes from CRM 2011

Post Author: Joe D365 |

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:

  1. The field is no longer needed
  2. The field was created incorrectly
  3. The field is never used
  4. The field has the wrong prefix
  5. The Display name has completely changed and the schema name no longer easily identifies the field
  6. ???

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:

  1. Remove the field from the form so that users cannot easily see the field or enter new data into it, at the same time preserving the data for a later date if/when it is needed. (You can always remove it later after you insure it is no longer needed)
  2. Make the field "Non-Searchable." Turning off the ability to search for this field will remove the field from being used in Advanced Finds (Going forward) and Workflows (Going forward).
  3. Moving the data contained in this field to another location (Example: Notes, or a newly created field that will hold the data from this old field), then removing the old field once the data has been preserved in another location.

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.

Deleting attributes from CRM 2011

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!

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

3 comments on “Best Practices for Deleting and Bulk Deleting Attributes from CRM 2011”

  1. 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

  2. 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

  3. 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!

PowerObjects Recommends