1

Good day everyone. I am trying to view all my events including the deleted records. My query looks like this.

List<Event> allEvent = [SELECT CreatedDate,Description,DurationInMinutes,EndDateTime,EventSubtype,Id,IsArchived,IsDeleted,RecordTypeId,Subject,WhatId,WhoId FROM Event ORDER BY CreatedDate DESC NULLS FIRST ALL ROWS];
System.debug('allEvent here: ' + allEvent);

The thing I am wondering is, what is the limitation of 'ALL ROWS'? What I thought is that it will get the data in the recycle bin. But what if I deleted the record many years ago and already not in recycle bin ? Can I still view it using 'ALL ROWS' ? I also tried deleting my file and after that I empty my recycle bin, but when I tried to query using 'ALL ROWS' it still show. Is it because deletion takes time before it will be completely deleted ? Please help. Thanks.

1 Answer 1

4

Records once deleted reside in the recycle-bin, and they stay there for 15 days unless to forcefully delete them.

  • Deleted records remain in the recycle bin for 15 days, and can be restored during that time. To permanently remove your deleted items before the 15-day period, administrators and users with the Modify All Data permission, can click Empty your Recycle Bin or Empty your organization’s Recycle Bin.
  • After 15 days, deleted items are purged from the recycle bin, and once purged, they can’t be recovered.

If the records are deleted from the Recycle Bin, you may still be able to query on the record to retrieve the information but you cannot Undelete the same.

There is no guarantee or period mentioned by Salesforce as to how long you would be able to query such records.

A pretty detailed discussion on the same topic can found on this question What is the life-cycle of deleted records.

0

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.