Sunday, July 19, 2009

How to get your deleted records back in CRM

Have you ever accidentally deactivated or deleted something in CRM that you wish you could get back? well, my coworkers have, so you're in luck :)

First of all, records aren't really deleted right away like you think would happen. They are MARKED for deletion, and then bulk deleted (this is ideal for performance).

Here's what to do:
1. Login to the SQL Server containing your CRM database
2. Find the table that holds your record of interest. For example, if you deleted an Account, you'll want to use the AccountBase table
3. Execute a query to find your record of interest, and then confirm that this is the appropriate record. For example, if you deleted an Account with the name of "Oops Enterprises", search for that
4. Execute the following update:
UPDATE SET DeletionStateCode = 0

Yay! Now if you go into CRM you'll see that your deleted object is still in there!

Disclaimer: Your records are eventually deleted, so you need to act as quickly as possible before they are actually deleted.

No comments:

Post a Comment