APPLICATION DESIGN
To add a trash folder to an application, create a new folder and assign it the name ($trash). You then need to write code for the folder events to handle the document deletions. For an example of how to program the events for the $Trash folder, see the Notes 6 mail template (mail6.ntf).
Example of programming a $Trash file
The following examples are taken from the $Trash folder in the Notes6 mail file:
Events
In the QueryRecalc event, the formula is:
@Command([MoveToTrash])
The Restore action uses the following code:
@Command([ToolsRunMacro];"(Restore Document)") {for Client}
@All
Delete
@Command([MoveToTrash]) {for Web}
Empty Trash
@Command([EmptyTrash]) {for Web & Client}
If you display a trash folder as a view applet in a Web application, documents marked for deletion in a Notes client are also marked for deletion in the view applet. But refreshing the view in a browser by pressing F5 does not delete the documents from the trash folder unless you create an action to empty the trash. For an example of this, see the Discussion template (discsw6.ntf).
Documents marked for deletion in the view applet will appear as marked for deletion in the Notes client after you close and reopen the database in the Notes client.
See Also