There is one document in a database that can not be deleted. I delete it and the cross appears next to it in the view, press the f9 key and the cross next to the document disappears but the document doesn’t.
This is the only document in the database that this happens to. I have manager access with delete rights, am a member of all roles and there is not any code anywhere that is stopping the deletion.
I have tried deleting it with the following code and still no luck. I always get a true message indicating that it has been deleted ok and what is weird is that this line can sometimes find the document and sometimes can’t but can always find it with the hard coded id.
Set dc = db.Search({Form = “frmDataOwner” & Database = “Master Index Non Anonymised”}, Nothing, 0)
Sub Click(Source As Button)
Dim session As New notessession
Dim db As notesdatabase
Dim dc As notesdocumentcollection
Dim doc As notesdocument
Dim success As Boolean
Set db = session.CurrentDatabase
'There is only one document with these details but sometimes dc.Count is 0 and at other times 1
Set dc = db.Search({Form = "frmDataOwner" & Database = "Master Index Non Anonymised"}, Nothing, 0)
If dc.Count = 0 Then
Msgbox "Not found"
End If
'id taken from document properties. finds this every time
Set doc =db.GetDocumentByUNID("6F39E7889C30E5898025727A003F1318")
success = doc.RemovePermanently(False)
'always get true
Msgbox success
Set doc = db.GetDocumentByUNID(“6F39E7889C30E5898025727A003F1318”)
'always get Deleted = False
Msgbox "Deleted = " & doc.IsDeleted
End Sub
I’m not too bothered by this as it is a test document in a template but am interested to know if anyone else has come across this and how they resolved it.