ok i want an agent that will search a view and put all the entries into an array
Code:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim arrName() As String
Dim i As Integer
Set db = session.CurrentDatabase
Set view = db.getView( "PCandLaptops" )
Set doc = view.GetFirstDocument()
i = 0
Do Until doc Is Nothing
Redim Preserve arrName(i) As String
arrName(i) = doc.getItemValue( "ComputerName_1" )(0)
Set doc = view.GetNextDocument(doc)
i = i + 1
Loop
End Sub
Agent properties
Name: Test
When should this agent run? Manualy from agent list
Which documents should it act on? Run Once
when it runs it says it finished successfuly, but there are no entries
if i put the same code into a form Action it works fine
how would i fix it to work in the agent?
thanks
Code:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim arrName() As String
Dim i As Integer
Set db = session.CurrentDatabase
Set view = db.getView( "PCandLaptops" )
Set doc = view.GetFirstDocument()
i = 0
Do Until doc Is Nothing
Redim Preserve arrName(i) As String
arrName(i) = doc.getItemValue( "ComputerName_1" )(0)
Set doc = view.GetNextDocument(doc)
i = i + 1
Loop
End Sub
Agent properties
Name: Test
When should this agent run? Manualy from agent list
Which documents should it act on? Run Once
when it runs it says it finished successfuly, but there are no entries
if i put the same code into a form Action it works fine
how would i fix it to work in the agent?
thanks