Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
Dim doc As NotesDocument
Dim y As Long
Continue = True
If( Source.Documents.Count > 0 ) Then
For y = Source.Documents.Count To 1 Step -1
Set doc = Source.Documents.GetNthDocument(y)
If Not( doc.Hasitem("$Conflict") ) Then
If( emsg Is Nothing ) Then Set emsg = New esamsg(Nothing)
'---------------------------------------------------------------------------------------------
'put here your specific code to control witch document can be deleted
'---------------------------------------------------------------------------------------------
If( doc.Form(0) = "document" ) Then
If( doc.Status(0) <> "1" ) Then
vEval = Evaluate(|@IsNotMember("[eAppAdmin]";@UserRoles)|)
If( vEval(0) ) Then
Continue = False
Messagebox emsg.getstring(eMSG_COMMON,eMSG_DELNOTAUTHORIZED,Null,Nothing), 16, emsg.getstring(eMSG_COMMON,eMSG_TITLE,Null,Nothing)
Exit For
End If
End If
Elseif( doc.Form(0) = "eannextask" ) Then
If( doc.Status(0) = "1" Or doc.Status(0) = "2" ) Then
vEval = Evaluate(|@IsNotMember("[eAppAdmin]";@UserRoles)|)
If( vEval(0) ) Then
Continue = False
Messagebox emsg.getstring(eMSG_COMMON,eMSG_DELNOTAUTHORIZED,Null,Nothing), 16, emsg.getstring(eMSG_COMMON,eMSG_TITLE,Null,Nothing)
Exit For
End If
End If
Elseif( doc.Form(0) = "eannexapproval" ) Then
If( doc.Status(0) = "0" Or doc.Status(0) = "1" ) Then
vEval = Evaluate(|@IsNotMember("[eAppAdmin]";@UserRoles)|)
If( vEval(0) ) Then
Continue = False
Messagebox emsg.getstring(eMSG_COMMON,eMSG_DELNOTAUTHORIZED,Null,Nothing), 16, emsg.getstring(eMSG_COMMON,eMSG_TITLE,Null,Nothing)
Exit For
End If
End If
End If
'---------------------------------------------------------------------------------------------
'end of your specifi code
'---------------------------------------------------------------------------------------------
End If
Next
If( Continue ) Then
Call eevents.Querydocumentdelete(Source,Continue)
End If
End If
End Sub