Is there a way to restore a deleted document that is located in the trash? All I know is the @UndeleteDocument formula.
Asked
Active
Viewed 192 times
1 Answers
2
Use evaluate
to execute @UndeleteDocument
on a document from a view of type
"Shared, contains deleted documents"
var viewTrash:NotesView = database.getView("trash");
var docToRestore:NotesDocument = viewTrash.getFirstDocument();
var eval = session.evaluate("@UndeleteDocument", docToRestore);
This example undeletes the first document from view "trash" which has to be of type "Shared, contains deleted documents".
There is no Java (nor LotusScript) method for undeleting a document. So, evaluate seems to be the appropriate way to handle this.

Knut Herrmann
- 30,880
- 4
- 31
- 67
-
Just as an FYI, here is the code I ended up with in a button, that retores all selected docuemnts in the view (using the checkbox in the column): var viewcontrol = getComponent("viewPanel1"); var ids = viewcontrol.getSelectedIds(); for(i=0; i < ids.length; i++){ var docId=ids[i]; var doc=database.getDocumentByID(docId); var eval = session.evaluate("@UndeleteDocument", doc); } – Ben Dubuc Dec 24 '14 at 16:41