1

Does the undelete via Apex behave the same way as Recycle bin undelete?

2

From the documentation:

The undelete DML operation restores one or more existing sObject records, such as individual accounts or contacts, from your organization’s Recycle Bin. undelete is analogous to the UNDELETE statement in SQL.

It is undeleting it from the Recycle Bin, so yes, I would say it should behave the same way.

  • For the sake of pointing it out, and based solely on my experience with DataLoader... I believe you ARE limited on how many records end up IN the recycle bin when bulk deleting(?). DataLoader seems to warn you about this when deleting a few thousand. Someone more knowledgeable than I should verify/clarify. – AMM Mar 18 '13 at 19:53
  • Thanks for responding. Went into panic as some accounts got deleted by accident. In the end I went one by one through the recycle bin instead of running some apex like this List<Contact> c = [select Id from Contact where IsDeleted = true limit 1000]; undelete c; – Michael Gill Mar 19 '13 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.