Guys i’m having a error “Notes Error: Error not foun in index” i created an agent which replaces the values in the documenthere’s the code:
Dim session As NotesSession
Dim uiw As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim view As NotesView
Dim doc As NotesDocument
Dim formula As String
Dim item As NotesItem
Dim one As String
Dim two,choice,server,datab,salesman,salesmanNum As String
Dim ct As Integer
Dim picklist As Variant
Dim messagelist As String
Dim dateonly As New NotesDateTime("")
Set uiview = uiw.CurrentView
Set view = uiview.View
Set session = New NotesSession
Set db = session.CurrentDatabase
Set doc = view.GetFirstDocument
choice = session.GetEnvironmentString("SalesChoice")
salesman = session.GetEnvironmentString("Salesman")
salesmanNum = session.GetEnvironmentString("SalesmanNum")
formula = |SELECT ((Form = "sales v2.0" & try="| & choice & |"))|
Msgbox (formula)
'formula = |SELECT ((Form = "sales v2.0" & cust_name2 ="002493"))|
view.SelectionFormula = formula
Call uiw.ViewRebuild
dateonly.LSLocalTime = Now
'Loop for replacing value
Do While Not (doc Is Nothing)
Set item = doc.ReplaceItemValue("zCust_2",doc.GetFirstItem("zCust2"))
Set item = doc.ReplaceItemValue("zCommod_2",doc.GetFirstItem("zCommod2"))
Set item = doc.ReplaceItemValue("zSrep_2",doc.GetFirstItem("zSrep2"))
Set item = doc.ReplaceItemValue("DateEffective_2",doc.GetFirstItem("DateEffective2"))
Set item = doc.ReplaceItemValue("salesman2",salesman)
Set item = doc.ReplaceItemValue("zSrep2",salesman)
Set item = doc.ReplaceItemValue("try",salesmanNum)
Set item = doc.ReplaceItemValue("DateEffective2",dateonly.DateOnly)
Call doc.Save (True,True)
Set doc = view.GetNextDocument( doc )
Loop
ct = view.EntryCount
Call session.SetEnvironmentVar( "count", ct )
Messagebox ("The number of docs in this view = " & ct &","&"Count of docs in view")
End Sub
the error is caused by “Set doc=view.GetNextDocument( doc )”