+ Start a Discussion
SfdcBlueFishSfdcBlueFish 

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

sfdcfoxsfdcfox

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.