Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Creating a Recycling Bin for your Notes applications

Mike O’Brien, Principal Application Developer, Replica Inc.
Mike R. O'Brien works for Replica Inc., a Lotus Business Partner in Indianapolis, Indiana. Mike is a Principal Application Developer, and has worked on Notes development for the last two and a half years. Prior to this, Mike was a Nuclear Materials Analyst for the US Air Force. He has developed manufacturing, pharmaceutical, and global workflow Notes applications. He has even created an application that was designed and used for use with a Teleprompter. The CEO of the corporation he designed it for used the teleprompter during a question-and-answer session he had with stockholders.

Summary:  This article looks at what happens when a user deletes a document and describes how to create a Recycling Bin in your own applications with LotusScript and formula language. An example database is available from the Sandbox.

Date:  02 Nov 1998
Level:  Intermediate

Activity:  2967 views
Comments:  

The mantra "recycle, reuse" has made its way into software applications. Windows users have the Recycle Bin, while Macintosh users have the Trashcan. Both options serve as deleted document staging areas, so users can easily recover the documents that they delete by accident. What you may not realize is that you can add this same functionality to your own Notes applications, and this article will show you how.

Using a little LotusScript and the Notes formula language, you can easily create a Recycling Bin for your Notes users. In this article, we'll first take a look at how the deletion process works, and determine what actually happens when a user deletes a document. Then, we'll know what to do to capture the document before it is deleted. The rest of the article describes exactly how to create a Recycling Bin in your own applications. In addition, it also looks at how this functionality will work in R5.

Note: You can try out the techniques described in this article by downloading the sample database from the Sandbox.

The Recycling Bin design: In a nutshell

The Recycling Bin is a collection of deleted documents, and you can present this collection to the user in either a view or a folder. The Recycling Bin is different than a Notes Trash folder in that the Recycling Bin is not self purging. If you create a folder and name it ($Trash), your Notes application will have a Trash folder just like your Inbox. You can drag documents into the Trash folder, and Notes marks these documents for deletion. The next time you close the database, or refresh it, you are prompted whether you want the documents removed from the database. Notes continues to prompt you until you either select to remove the documents from the database, or remove them from the Trash folder. In contrast, when a document is deleted and placed in the Recycling Bin, it will reside there until you decide to remove it, or restore it. You will not be prompted each time the database is closed, or refreshed. There are advantages to both, a Trash folder and a Recycling Bin, but this article focuses only on the Recycling Bin. (For information on creating Trash folders, see the TechNote #145220, "How to Create a Trash Folder in a Notes Database" from Lotus Support).

The first step in setting up the Recycling Bin is to capture the documents marked for deletion. Let's take a look at the deletion process and the associated database events.


Understanding the document deletion process

Every Notes database has three database events related to the deletion of documents: QueryDocumentDelete, PostDocumentDelete, and QueryDocumentUndelete. To create the Recycling Bin functionality, you need to place LotusScript in one of these events to capture the deleted documents and place them in the Recycling Bin. Let's take a look at how the deletion process works:

  1. When you select a document (or multiple documents) in a view and press the Delete key, the QueryDocumentDelete event executes. After the QueryDocumentDelete event finishes, a trashcan icon appears next to the selected document in the left column.
  2. After the trashcan icon appears, one of the following can occur:
    • If you close the database or press F9, Notes prompts you with a Yes/No dialog box, asking whether you want to remove the selected documents from the database. If you click Yes, the PostDocumentDelete event executes.
    • If you press the Delete key again, the QueryDocumentUndelete event executes, and the trashcan icon is removed from the left column.

Before you can determine where to place the LotusScript for putting the deleted documents into the Recycling Bin, you need to decide where your Recycling Bin will reside. Because the Recycling Bin is nothing more than a folder or a view, it can reside in the same database or in a separate database. This article describes how to set up the Recycling Bin in either place. I prefer to keep it in the same database, because all the related documents are there for reference.

Let's take a closer look at the three database events available to us.

QueryDocumentDelete event

This is the first event to execute in the deletion process, and it executes before a document is deleted. This event also has two parameters: NotesUIDatabase and Continue. The second parameter, Continue, determines whether a document is allowed to be deleted. If you set continue to False in the event, it disables document deletions from the database, as shown in the following code.

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant) Continue = False End Sub

If your Recycling Bin resides in the same database, you can place your script within this event to capture the deleted documents. You can also use this event if your Recycling Bin resides in a separate database.

PostDocumentDelete event

This event executes only after you click Yes to the prompt -- that you do want the selected documents deleted. This event executes after the document has been deleted. Unlike the QueryDocumentDelete event, this event does not have a Continue parameter.

Because this event executes after the document has been deleted from the database, you cannot use it if your Recycling Bin will reside in the same database. However, you can use it if your Recycling Bin will reside in a separate database.

QueryDocumentUndelete event

This event executes only if you change your mind and press the Delete key to "undelete" a document marked for deletion. Because you have already decided not to delete the document, this event would not be a good candidate to capture the document and place it in a Recycling Bin.

Now that you have a basic understanding of the events available, let's look at how we can use them to capture documents and place them in the Recycling Bin.


Capturing deleted documents

The method you use to capture deleted documents depends on whether you store the Recycling Bin in the same database, or in a separate database. As I stated earlier, I like to keep the Recycling Bin in the same database, but you may have a group of related databases where you want to keep all the deleted documents together for historical purposes. Then, you may want to keep the Recycling Bin in a separate database. If the Recycling Bin resides in the same database, you can capture the document(s) during the QueryDocumentDelete. If the Recycling Bin will be in a separate database, you can use either the QueryDocumentDelete or PostDocument Delete event. We'll look at how to set up the functionality using either event. Let's start first with the QueryDocumentDelete with the Recycling Bin being in the same database.


Capturing documents with the Recycling Bin in the same database

When the document is captured in the QueryDocumentDelete event, the document is not actually deleted from the database. The document is removed from all the views in the database by changing a few field values. By changing the field values, the document appears in the Recycling Bin. The view selection formulas in the sample database and the following code examples are very simple. You need to change just a few fields to remove the document and place it in the Recycling Bin. For this technique to be successful in your application, make sure that you change any field value that is used in a view selection formula; otherwise, because the document is still in the database, it will still appear in the regular views. If you have views in your database that use a selection formula like Select @All, and you need to keep that selection formula, then you could change your formula to something like Select Form != "Deleted." You would then get the same results.

Before we get ahead of ourselves, let's look at the code. The first step is to get a handle on all the documents marked by the user for deletion. This is done by using the Document property of the NotesUIDatabase, which returns a document collection of all the documents marked for deletion.

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
     
     Dim s As New NotesSession     
     Dim ws As New NotesUIWorkspace     
     Dim dc As NotesDocumentCollection     
     Dim Responses as NotesDocumentCollection
     Dim doc As NotesDocument
     
     Set dc = Source.Documents

The next step is to have the user verify that Yes, they want the documents deleted. The messagebox statement is nested in the If statement. If the user answers No to the question, no processing is performed on the selected documents.

     Beep
     If Messagebox("You have Selected " & dc.Count & " document(s) to be deleted.  
     Are you sure you want to delete these documents?" , _
     36 , "Confirm Document Deletion") = 6 Then
          

If the user answers yes, we get a handle on the first document in the collection. The Do statement forces the code to continue until the variable doc is Nothing, meaning a Set doc = .. returned nothing.

Set doc = dc.GetFirstDocument Do Until (Doc Is Nothing)

This is the heart of the operation. The view selection formulas in the sample database are based on the form used to create the document. Then, we change the field value to "Deleted Documents." If your view selection formulas are based on a different field, you would have to change that field's value here to ensure that the deleted document does not appear in the view.

doc.OldForm = doc.Form doc.Form = "Deleted Document"

Next, we identify who deleted the document, and when. Then, we save the changes made to the document.

doc.DeletedBy = S.CommonUserName doc.DeletedOn = Now Call Doc.Save(True, False)

Now, we want to check whether the deleted document has any response documents. If there is at least one response document, we call the subroutine ProcessResponseDocuments. (The next section explains the ProcessResponseDocuments subroutine.) This is done to avoid orphaned response documents. Although the user may have selected the response documents at the same time, I have found that it is better to process them as if the user did not select them. If you count on the user selecting the main document and all of its descendants, you are bound to have orphaned documents.

Here, we get a handle on the next document in the document collection and start the process again.

Set doc = dc.GetNextDocument(doc) Loop

Then, we refresh the view the user has open. This removes all the documents that have just been processed.

Call ws.ViewRefresh End If

Finally, we use Continue = False to disable the conventional document deletion.

Continue = False End Sub

The ProcessResponseDocuments subroutine

Let's look at the ProcessResponseDocuments subroutine. This subroutine "deletes" the response documents of any document that was deleted by the user. Again, we start by getting a handle on the first document of the passed document collection.

Sub ProcessResponseDocuments(s As NotesSession, Responses As NotesDocumentCollection)
     Dim CurrentResponse As NotesDocument     
     Dim CurrentResponseResponses As NotesDocumentCollection
     
     Set CurrentResponse= Responses.GetFirstDocument     
     While Not (CurrentResponse Is Nothing)

Here, we make the values changed on the response document the same as the values of the main document.

CurrentResponse.OldForm = CurrentResponse.Form               
CurrentResponse.Form = "Deleted Document"
CurrentResponse.DeletedBy = S.CommonUserName
CurrentResponse.DeletedOn = Now
Call CurrentResponse.Save(True, True)

Next, we need to check if the current response document has any response documents. If the current document has at least one response document, we call the subroutine ProcessResponseDocuments. This recursive call continues until all the response documents have been processed.

Set CurrentResponseResponses = CurrentResponse.Responses
If CurrentResponseResponses.Count >= 1 
   Then Call ProcessResponseDocuments(s, CurrentResponseResponses)

Then, we step to the next document in the passed collection.

Set CurrentResponse = Responses.GetNextDocument(CurrentResponse)
Wend
End Sub


Capturing documents with the Recycling Bin in a separate database

If you want to put the Recycling Bin in a separate database, the best place to capture the deleted document is in the QueryDocumentDelete event. For the Recycling Bin to be in a separate database, this requires that both databases, the Recycling Bin database and the database that the documents are deleted from, to be set up as mail-in databases. The reason is that when the documents are removed, you can maintain the same document UNID's if you're using mail-in databases.

The main differences in this code is that we do not need to change the field information, and we process the response documents differently. In addition, we use a profile document for storing the mail-in database names. Let's look at the QueryDocumentDelete event code, which begins by defining the profile document and then uses the Documents property of the NotesUIDatabase class to get a handle on the documents that have just been deleted.

Sub Postdocumentdelete(Source As Notesuidatabase)
          
     Dim s As New NotesSession     
     Dim dc As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim Responses As NotesDocumentCollection     
     Dim pDoc As NotesDocument
     
     Set pdoc = source.database.GetProfileDocument("Application Settings")
     Set dc = Source.Documents

Then, we get a handle on the first document in the document collection, and begin looping through all the documents in the collection.

Set doc = dc.GetFirstDocument Do Until (Doc Is Nothing)

Next, we set the SendTo and OldDatabase fields to the values in the profile document. The SendTo field is used to identify where the document is mailed to. The OldDatabase field is used if the document is restored (or "undeleted"). It identifies the mail-in name for the current database.

doc.SendTo =pDoc.RecycleBinMailName doc.OldDatabase = pDoc.CurrentDatabaseMailName

Here, we identify who deleted the document, and when.

doc.DeletedBy = S.CommonUserName doc.DeletedOn = Now

Then, we get a handle on the response documents for the current document. If there is at least one response document, we call the MailResponseDocuments subroutine. (The next section explains the MailResponseDocuments subroutine.)

Set Responses = doc.Responses

If Responses.Count >= 1 Then Call MailResponseDocuments(s, Responses)          
          
'Mail the Document to the Recycling Bin Database
Call doc.Send ( False)
Set doc = dc.GetNextDocument (Doc)
Loop

Another difference in this code is our subroutine, RemoveMailedResponses. (We'll look at the RemoveMailedResponses subroutine in a minute.) Because the response documents were mailed to the Recycling Bin, that means they have been deleted. But unless the user selected the response documents, they are not deleted from the database, so we need to remove them from the database.

Call RemoveMailedResponses(Source.Database) End Sub

The MailResponseDocuments subroutine

Now that all the selected documents have been mailed to the Recycling Bin database, let's look at the MailResponseDocuments subroutine. Again, we start by getting a handle on the first document of the passed document collection.

Sub MailResponseDocuments(s As NotesSession, Responses As NotesDocumentCollection, 
                          RecycleBinName As String , CurrentName As String)
     Dim CurrentResponse As NotesDocument     
     Dim CurrentResponseResponses As NotesDocumentCollection

     Set CurrentResponse= Responses.GetFirstDocument     
     While Not (CurrentResponse Is Nothing)
          

Next, we set the SendTo and OldDatabase fields to the values passed in the subroutine. The SendTo field identifies where the document is mailed to. The OldDatabase field is used if the document is restored (or "undeleted"). It identifies the mail-in name of the current database.

CurrentResponse.SendTo = RecycleBinName$ CurrentResponse.OldDatabase = CurrentName$

Then, we get a handle on the response documents for the current document. If the current document has at least one response document, we call the subroutine ProcessResponseDocuments. This recursive call continues until all the response documents are processed.

Set CurrentResponseResponses = CurrentResponse.Responses

If CurrentResponseResponses.Count >= 1 
  Then Call MailResponseDocuments
   (s,CurrentResponseResponses, RecycleBinName$, CurrentName$)

Here, we identify who deleted the document, and when. Then, we save the document, so the values will be available in the Recycling Bin database. And then, mail the response document to the Recycling Bin database.

CurrentResponse.DeletedBy = S.CommonUserName
CurrentResponse.DeletedOn = Now

Call CurrentResponse.Save(True, True)

Call CurrentResponse.Send ( False)

Finally, we step to the next document in the passed collection

Set CurrentResponse = Responses.GetNextDocument(CurrentResponse) Wend End Sub

The RemoveMailedResponses subroutine

Now that all the response documents have also been mailed to the Recycling Bin database, let's take a look at the RemoveMailedResponses subroutine. This subroutine removes all the documents that were just mailed to the Recycling Bin. First, we create a document collection of all the documents that have the field OldDatabase.

Sub RemoveMailedResponses(db As NotesDatabase)
     Dim dc As NotesDocumentCollection
     Set dc = db.Search({@IsAvailable(OldDatabase)}, Nothing, 0)

Then, we remove all the documents in the document collection.

Call dc.RemoveAll (True) End Sub

The next step is to create a view that displays the deleted documents.


Creating the Recycling Bin view in the same database

Let's first look at the Recycling Bin view when it is in the same database. Then we'll examine it if the Recycling Bin is in a separate database.

The key to setting up the Recycling Bin view is to make sure that the displayed values help the user to decide whether the documents should be restored or removed from the database. In the sample database for this article, my Recycling Bin view displays the original form type, who deleted the document, and when it was deleted. These are the values that are set during the QueryDocumentDelete and ProcessResponseDocuments events.

The selection formula for the view is:

Select form = "Deleted Document"

The column formulas are just the fields that were set in the processing events, as shown in the following screen.


Figure 1. The columns
The columns

Creating the action buttons for the Recycling Bin view

Like any other view, the Recycling Bin requires some action buttons. The three actions I find useful are: Remove All From Database, Remove From Database, and Restore Document.

Remove All From Database action

This action button removes all the documents in the Recycling Bin from the database. The first step is to create a document collection of all the documents in the Recycling Bin. An easy way to do this is to have the first column in the Recycling Bin view be a hidden sorted column with a formula for its value. The following screen shows the formula for this hidden column.


Figure 2. The formula for the hidden column
The formula for the hidden column

By having the column sorted, we can use the GetAllDocumentsByKey method. Then, we can check if the document collection is populated. If there is at least one document in the collection, we prompt the user as to whether or not they want to remove the documents from the database.

Set dc = s.CurrentDatabase.GetView("RecycleBin").GetAllDocumentsByKey("1")

If dc.Count > 0 Then
    If Msgbox("Are you sure you want to remove all " & dc.Count & 
          " documents from " & s.CurrentDatabase.Title & "?",  20 , 
          "Remove all documents from Recycle Bin")  = 6 Then

If the user clicks Yes, we use the documentCollection method, RemoveAll. This removes all the documents in the Recycling Bin from the database. Then, we refresh the Recycling Bin view, so all the documents are removed from the user's view.

               Call dc.RemoveAll(True)               
               Call uiwks.ViewRefresh
          End If     
     End If
End Sub

Remove from Database action

This button removes only the selected documents from the Recycling Bin. Again, the first step is to create a document collection of all the selected documents in the view. The UnprocessedDocuments property, when used from a view, contains all the selected documents in the view.

Set dc = s.CurrentDatabase.UnprocessedDocuments

Unlike the Remove All action button, we do not need to check that there is at least one document in the collection before prompting the user with the deletion question. This is because the UnprocessedDocuments will always return at least one document.

If Msgbox("Are you sure you want to remove all " & dc.Count & 
          " documents from " & s.CurrentDatabase.Title & "?",  20 , 
          "Remove all documents from the Recycle Bin")  = 6 Then

If the user clicks Yes, the selected documents are removed, and the view is refreshed.

Call dc.RemoveAll(True) Call uiwks.ViewRefresh End If

Restore Document action

This button restores the document and removes it from the Recycling Bin. Again the examples here are very simple, basically what happens is that all the values that were changed during the QueryDocumentDelete and ResponseProcessing events are reset. First, we use the UnprocessedDocuments property to get a handle on all the selected documents. Then, we get a handle on the first document in the collection and reset the field values on that document.

Set dc = s.CurrentDatabase.UnprocessedDocuments
  Set doc = dc.GetFirstDocument          
  Do Until (Doc Is Nothing)
       doc.Form = doc.OldForm
       Call doc.RemoveItem("OldForm")
       Call doc.RemoveItem("DeletedBy")
       Call doc.RemoveItem("DeletedOn")
       Call Doc.Save(True, False)

Here, we get a handle on the next document in the document collection, and continue the processing. Then, we refresh the Recycling Bin View.

Set doc = dc.GetNextDocument(doc)
Loop

Call uiwks.ViewRefresh


Creating a form for viewing deleted documents

There are a couple of options for viewing the documents in the Recycling Bin:

  1. Users can open the documents with their original form.
  2. You can create a different form for viewing deleted documents.

The examples in this article use the second option. This form is designed so that the user does not confuse the deleted document with a document that has not been deleted. When a user opens a deleted document, here is what they see:


Figure 3. The dialog box that appears when you open a deleted document
The dialog box that appears when you open a deleted document

The "View Old Doc Type" action button uses the following formula:

@Command( [ViewSwitchForm] ; OldForm )

This allows the user to see the document with its original form. If you prefer to see the document with its original form, you can use a view form formula like:

@If(@IsNewDoc; form; OldForm).

This will open the document using the original form.


Creating the Recycling Bin in a separate database

Just as the documents were treated differently when they were placed in the Recycling Bin in the separate database, the Recycling Bins themselves are set up differently. If you remember, when the documents were mailed to the Recycling Bin, the form name was left unchanged. Because the form name was not changed, the Recycling Bin database needs to have a copy of the form used to create the document. If you do not want to have copies of the forms in the Recycling Bin, you can change the flag on the Send code to True -- that is, Call doc.Send (True). This embeds the form when it is sent to the Recycling Bin. The downside to this is that if the document is later restored, its form may not be the same as the most current version.

The next difference is the view action buttons. The "Remove all documents" and "Remove selected documents" actions stay the same, while the "Restore document" action is different. Let's examine the code for the Restore Document action. First, we get a handle on all the selected documents, and then get a handle on the first document in the document collection.

Sub Click(Source As Button)
     Dim uiwks As New NotesUIWorkspace
     Dim s As New  NotesSession
     Dim dc As NotesDocumentCollection
     
     Set dc = s.CurrentDatabase.UnprocessedDocuments  
        
     Set doc = dc.GetFirstDocument         
     Do Until (Doc Is Nothing)
          

Next, we set the SendTo field equal to the database the document came from, remove the OldDatabase field, and then save and send the document.

doc.SendTo = doc.OldOldDatabase

Call doc.RemoveItem("OldDatabase")

Call doc.Save(True, False)
Call doc.Send(False)

Then, we get a handle on the next selected document, and restart the process.

Set doc = dc.GetNextDocument(doc) Loop

Finally, we remove all the documents in the document collection, and refresh the user's view.

Call dc.RemoveAll (True) Call uiwks.ViewRefresh End Sub


Caveats and special considerations

You now have all the basics for creating your own Recycling Bin. But what kind of changes are needed to incorporate the functionality into a current application? The answer to that question really depends on where the Recycling Bin will reside.

When the deleted documents are stored in the same database, there are a few things that may require some additional modifications. This is due to the fact that the documents are still in the database. For example, things like folders, views, and agents may need to be changed, so that they do not include the deleted documents in their scope. (Another caveat is that "Editor" access is required to delete response documents authored by others.)

Folders

Folders present a unique problem to the Recycling Bin functionality. Documents in folders are not there because of a selection formula, like in a view, but they are there because a user or a piece of code placed them there. That means a user or a piece of code must take them out of the folder, if the document is to stay in the database. If you want to place the Recycling Bin into a database that has quite a few folders, more than two or three, then I would suggest using the separate database as the Recycling Bin. If, on the other hand, your application does not have folders or only a couple of them, the following subroutine can be used to remove documents from folders. You would place the call to this subroutine right before the GetNextDocument call is made in both the QueryDocumentDelete and ProcessResponseDocument events.

This is how the call would look to the subroutine from the QueryDocumentDelete subroutine.

Call RemoveDocumentsFromFolders(doc) Set doc = Responses.GetNextDocument(doc)

Or, you could instead use the following call to the subroutine from the ProcessResponseDocuments subroutine.

Call RemoveDocumentsFromFolders(CurrentResponse ) Set CurrentResponse = Responses.GetNextDocument(CurrentResponse)

Then, here's the code for the RemoveDocumentsFromFolders subroutine. All the folder names are stored in a computed when composed field on the form. For each folder name in the field, the NotesDocumentMethod RemoveFromFolder is executed.

Sub RemoveDocumentsFromFolders(doc As NotesDocument)
     Forall Folders In doc.FolderNames
          Call doc.RemoveFromFolder(Folders)
     End Forall
End Sub

View selection formulas

If your application currently has a very broad selection formulas for some or all of its views, such as Select @All, you will have change those formulas. If you do not change the selection formulas, the deleted documents will still appear in the views. In order for the Recycling Bin functionality to work correctly, your view selection formulas must not include the deleted documents. Deleted documents should only appear in the Recycling Bin view.

Agents

Depending on the scope of the agent, it may require modification. Because the possibilities are endless, I only bring it up here just to remind you. You should look at your agents before implementing the Recycling Bin in your Notes applications.


New delete options in Notes R5

Now, you may be wondering how this Recycling Bin functionality will work in Release 5, once you've incorporated it into your application. The good news is that this functionality will work fine in R5. The great news is that you won't need to do any coding to recreate the functionality in R5. Lotus and Iris have made quite a few improvements in the area of document deletion and archiving. Namely, they have built the Recycling Bin functionality right into the database architecture! Although our code will still work in R5, it is not necessary.

Now in R5, you can just select a few database and view properties to create most of the Recycling Bin functionality. The first step is to turn on the "Allow soft deletions" database property. What this does is place a Soft Delete status flag on any document that a user deletes. The document is temporarily deleted from the user interface -- that is, it is removed from all the views and folders. The $Undelete Expire Time controls how long a deleted document is available for undeleting. If the document is not undeleted before the $Undelete Time expires, the document is permanently deleted from the database. The following screen shows these new database properties.


Figure 4. The Database Properties box
The Database Properties box

Now that you have deleted the documents, you need a way to display them. In R5, you can create a view that contains deleted documents. The following screen shows the new view type "Shared, contains deleted documents."


Figure 5. The Create View dialog box
The Create View dialog box

Now that the Recycling Bin has been created, we need to create the action buttons. In R5, all of the code used in our action buttons has been replaced by two new commands: @UndeleteDocument and @HardDeleteDocument. The @UndeleteDocument command restores soft deleted documents -- serving the same function as our RestoreDocument subroutine, while the @HardDeleteDocument totally removes documents from a database -- the same functionality as our Remove from Database code.

Also in R5, response document handling has been taken care of for us by another simple click. The following screen displays some of the new document archiving and deletion properties. The new property I like is the "Do not delete a document until all of its responses have been archived." With that property turned on, all the functionality of the Recycling Bin has been replaced.


Figure 6. The Document Archiving and Deletion dialog box
The Document Archiving and Deletion dialog box

Conclusion

This article has described how you can create a Recycling Bin in your Notes applications. You can either create the Recycling Bin in the same database, or in a separate mail-in database. This article also gave you a peek at the document deletion options in R5. My hope is that this article will help you to enhance your Notes applications -- bringing recycling in for your users.


Resources

About the author

Mike R. O'Brien works for Replica Inc., a Lotus Business Partner in Indianapolis, Indiana. Mike is a Principal Application Developer, and has worked on Notes development for the last two and a half years. Prior to this, Mike was a Nuclear Materials Analyst for the US Air Force. He has developed manufacturing, pharmaceutical, and global workflow Notes applications. He has even created an application that was designed and used for use with a Teleprompter. The CEO of the corporation he designed it for used the teleprompter during a question-and-answer session he had with stockholders.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Lotus
ArticleID=23425
ArticleTitle=Creating a Recycling Bin for your Notes applications
publish-date=11021998
author1-email=dwinfo@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers