Archive notes error cause of missing documents

Asked By 0 points N/A Posted on -
qa-featured

Hello experts,

I don’t know why I cannot delete some files or what documents are still needed in the database but I would like to skip this error because I really need to delete them. Can anyone help me please to skip this error ?

Thank you !

Notes error: Some of the selected documents were not deleted because they are still required in this database.

OK

SHARE
Answered By points N/A #178279

Archive notes error cause of missing documents

qa-featured

Hello,

Such issue is not uncommon to face. To work around this issue,

1. From “Designer client”, go to mail database or template.

2. From “Design elements” list, choose Others >> Database Resources.

3. Open “Database Script design element” from “Design pane”.

4. Select “PostDropToArchive” event.

5. Depending on your Notes version, modify the code as following.

For Notes 7.x, 8.0.x templates:

Sub Postdroptoarchive(Source As Notesuidatabase, Entryname As Variant, Continue As Variant) 
Dim policy As String 
Dim ws As New NotesUIWorkspace 
Dim collection As notesdocumentcollection 

policy = entryname 
Set collection = source.documents 

On Error 4000 Goto Error_4000 'Add this line 
Call source.Database.ArchiveNow( collection, policy ) 
Call ws.CurrentView.DeselectAll 'Add this line 
Call ws.CurrentView.View.Refresh 

'Add lines below 
Exitsub: 
Exit Sub 
Error_4000: 
Messagebox Error 
If Error="Notes error: Some of the selected documents " &_ 
"were not deleted because they are still required in this database." Then 
Resume Next 
Else 
Resume Exitsub 
End If 
End Sub 

 

For Notes 6.x templates:

Sub Postdroptoarchive(Source As Notesuidatabase, Entryname As Variant, Continue As Variant)

Dim policy As String 
policy = entryname

Dim collection As notesdocumentcollection 
Set collection = source.documents

On Error 4000 Goto Error_4000 'Add this line 
Call source.Database.ArchiveNow( collection, policy ) 
Dim ws As New NotesUIWorkspace 
Call ws.ViewRebuild

'Add lines below 
Exitsub: 
Exit Sub 
Error_4000: 
Messagebox Error 
If Error="Notes error: Some of the selected documents " &_ 
"were not deleted because they are still required in this database." Then 
Resume Next 
Else 
Resume Exitsub 
End If 
End Sub

Related Questions