One of my users accidentally deleted a document from a document folder. Is there a way to restore a deleted document? I checked the Recycle Bin, but it appears that it's only used to store deleted object records and not documents.
Thanks,
Greg
4 respuestas
Hi,
There are several ways of doing it
- Access the Recycle Bin and change the drop down menu to All Recycle Bin. Search for the missing records, or sort the data to manually review the deleted records. Review Recycle Bin. If the record is visible in the Recyle Bin, select that item and click Undelete to restore it, review View, Restore, and Manage the Recycle Bin in Salesforce Classic. If there are too many records to undelete manually in the Recycle Bin, you may be able to use Workbench, review Restore multiple records that are in recycle bin
- You can also use the IsDeleted keyword in our query along with ALL ROWS. See Restoring Deleted Records to learn more
For example:
Contact[] c = [select id from contact where isDeleted = true LIMIT 1000 ALL ROWS];
As we are talking about files, you should add isDeleted to ContentDocumentLink
SELECT ContentDocumentId, LinkedEntityId FROM ContentDocumentLink where LinkedEntityId: (Your linkedEntity ID) and LinkedEntity.Type= (Your LinkedEntityType)
- In the Data Loader, click Export All.
- Select the object and choose the target for export file. Click Next.
- Click Select all fields.
- Create filter 'IsDeleted' = True. Click Add Condition.
- Click Finish.
- Open the CSV file.
details: https://developer.salesforce.com/forums/?id=9062I000000QyQcQAK