Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared, Private on First Use folder

Status
Not open for further replies.

fishkake

MIS
Feb 11, 2004
130
GB
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:

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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top