locked
Recover Deleted Records CRM C# RRS feed

  • Question

  • Hi ,

    I need to Recover Lead , Account , Contact  Deleted Records. using plugin.

    For this approach i have designed a custom entity . 

    * I have created  a custom entity "Recover Records". 

    * I have 3 Attribute Entity Name , Recover Records Between  Start Date to End Date .

    On select of this 3 attribute , i need to Retrieve all the records which are deleted between this dates. 

    * For retrieve deleted records i need to set Auditing. 

    Can u plz guide how to set auditing for recover records. 

    How to recover the records using c# plugin. Based on Auditing Created ?

    Any Sample code to recover deleted records. ? 

    I have attached custom entity Design for  reference. 

    Thanks


    • Edited by kMAT1 Sunday, November 16, 2014 1:53 PM
    Sunday, November 16, 2014 1:52 PM

All replies

  • a better approach would be to remove delete permission from all users and as users to deactivate unwanted records / and active them manually or using a plugin. Have you tried to sell this to the business?. It will save you heaps of overhead.

    regards

    Jithesh

    Sunday, November 16, 2014 9:03 PM
  • Hi ,

    My customer needs a plugin which need to perform Recover Data.  instead of De Activate. 

    I hope there are loot of external tool . 

    But i would like to prefer in doing of plugin logic.

    can any body assist on this. 

    how to achieve on this / proceed on this further...

    Thanks 

    Thursday, November 20, 2014 10:51 PM
  • Even if you could read the audit data via a plugin (which isn't easy), I doubt you'd have enough information to be able to re-construct the deleted records. After all, I'm pretty sure deleting the record also deletes the audit history for it!

    As Jithesh says, an alternative approach is needed for the business so users are either prevented from deleting OR create a synchronous workflow that triggers on delete (run before) and writes data to another entity (let's call it the 'to be deleted' entity). To be honest, even this feels messy and will only hurt the performance of your system. If the business is worried about deleting things and trying to recover deleted data they really need to stop deleting it and de-activate instead.

    Rob


    MCTS. GAP Consulting Ltd. Microsoft Community Contributor Award 2011 & 2013

    Thursday, November 20, 2014 11:39 PM