Hello again!
I'm trying to use a Shared/Private folder to display documents which match certain criteria, one of which is the position of the current user's name within each document. I have created the following agent:
This agent is supposed to empty the folder, and then fill it with the correct documents.
According to the debugger, the line I have marked (>>) is the problem, and I get an error message saying that the index is not to be generated on the server. I'm sure that this is a problem with two folders existing at once (one private, one shared), but please help me work around this!
I'm trying to use a Shared/Private folder to display documents which match certain criteria, one of which is the position of the current user's name within each document. I have created the following agent:
Code:
Sub Initialize
Dim dc As NotesDocumentCollection
Dim s As New notessession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim x As Integer
Dim cUser As New NotesName(s.UserName)
Dim ApprovalsFolder As NotesView
Dim nvec As NotesViewEntryCollection
Set db = s.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Set ApprovalsFolder = db.GetView("MyApprovals")
>>Set nvec = ApprovalsFolder.AllEntries
If nvec.Count >0 Then
Call nvec.RemoveAllFromFolder("MyApprovals")
End If
While Not doc Is Nothing
'Call doc.RemoveFromFolder("MyApprovals")
x = getStateDoc(doc)
If x<4 Then
If doc.Items(8+x).text = cUser.Abbreviated Then
Call doc.PutInFolder("MyApprovals")
End If
End If
Set doc = dc.GetNextDocument(doc)
Wend
End Sub
This agent is supposed to empty the folder, and then fill it with the correct documents.
According to the debugger, the line I have marked (>>) is the problem, and I get an error message saying that the index is not to be generated on the server. I'm sure that this is a problem with two folders existing at once (one private, one shared), but please help me work around this!