Restore Deleted Item

Description

The article describes a way to restore item without having to restore the whole database and start time-consuming data migration operation.

Version

All versions of eWay-CRM

Difficulty

High

Resolution

If you delete an item, related items are still in eWay-CRM - you delete only relations, not related items themselves. eWay-CRM stores information about delete relations, so it is possible to restore them. But eWay-CRM can only restore relations, not the item itself with its attributes like name, note, etc. Because of it, user has to create new item to which will be the deleted relations restored.

Please follow these steps:

  1. Create new item in the same modules as the deleted one.
  2. Run eWaySP_RestoreDeletedRelations procedure in your database. You can run it over server database and specify three values:
ParameterDescription
@FolderName Database name of the module from what the item was deleted (new item must be in the same module).
@DeletedItemGUID Unique identifier (GUID) of deleted item.
@NewItemGUID Unique identifier (GUID) of new item to which will be the relations restored.

There is an example of use (description to all values is right in the code - you can copy it with that, it is commented out, you just need to change values to your needs):

EXEC dbo.eWaySP_RestoreDeletedRelations
 N'Projects', -- module name, Projects can be changed to other database name of the module due to your needs
 'GUID1', -- GUID of deleted item
 'GUID2' -- GUID of new item that already exists and is in same module as deleted one