function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Trigger On UNDELETE Master records

Hi Friends,


     I am new to cloud, can u any body tell me the way to achieve this,


 Scenario:  if we undelete master record from recycle bin  auto matically child records will undeleted from recycle bin,


Now I need to trigger for that scenario,if we undelete master record from recyclebin then trigger will fire and it delete all  child records which belongs to that master record  from recycle bin.


ThanX in Advance


If you're referring to the mechanism whereby if you delete an account, the contacts are removed, and if you recover this account from the Recycle Bin, the contacts are automatically recovered, this feature is already part of the core platform. You should not need to code for this for any master-detail relationships that include cascading deletes. If you have a custom trigger to delete children records that are not explicitly deleted when the parent is deleted, you'll need to use a "SELECT ... ALL ROWS" query to find the deleted records and use the undelete feature available in Apex Code.