Confirmation of Deletion

This tip is an easy method to ask an user for confirmation before deleting any document in a Domino Web application. There is no straightforward way to ask for confirmation and delete the marked documents only from a view for applications on the Web. Hence, use a JavaScript confirmation box in the delete action. Update a field, say, DeleteConfirm field on the form to "yes" or "no". "Yes", if user presses "OK" on the confirmation box....

"No" otherwise.

In the view, write the selection formula to include only those documents where DeleteConfirm field is not marked to "Yes". Run a scheduled agent on a view that that selects all the documents marked with DeleteConfirm field as "Yes" and use RemoveAll method to delete them.


Delete Documents agent:

Sub Initialize 
        Dim Session As New NotesSession 
        Dim db As NotesDatabase 
        Set db = Session.CurrentDatabase 
        Dim view As NotesView 
        Set view = db.GetView("DeleteDocuments") 
        Call view.Refresh       
        Dim collection As NotesDocumentcollection 
        Set collection = view.GetAlldocumentsbykey("Yes",True) 
        Call collection.RemoveAll(False) 
        
End Sub

Javascript for Delete Action button:

if (confirm("Are you sure you want to permanently delete this document?")) 
{ 
            alert("This document has been Deleted"); 
          document.forms[0].DeleteConfirm.value = "Yes"; 
            window.document.forms[0].submit(); 
                   
} 
else { 
      alert("This document is not being Deleted"); 
         document.forms[0].DeleteConfirm.value = "No"; 

          }

This was first published in March 2001

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close