Dynamics Tutorial: ‘record could not be deleted because of an association’

You may have seen this one before and been a little frustrated..

Important: Records in CRM should not really be getting deleted in real world production environments. Data is there for a reason and history, auditing etc. should be considered. Deleting a record prevents you from seeing why it was there or for what reason it is no longer needed and you should consider deactivating a record.

Even though the above is true, you may have a dev system where you want to delete some data but you can’t because of the above message ‘Record could not be deleted because of an association’. This is caused by an obvious reason, it is linked to another record which needs to be deleted first therefore it refuses to be deleted.

So how do you find out what records it is linked to as these might not easily be seen when looking at the related areas via the Blue main navigation bar. You need to find out what entities the record is linked to and then do an advanced find based on these.

If you want to see what the ‘restrict delete’ relationships are go to:

Settings -> customization -> Customize the system > Expand your Entity -> (Account or which ever is relevant to you)> 1:N relationship > Check for relationships which says ‘Referential, Restrict Delete’. Now do an advanced find on these to find out which entities your record which cannot be deleted is linked to. 

referential-restrict-delete

I hope this points you in the right direction.