I get Type mismatch when the script reach txtEvaluate, anyone who now why?I’m looking in a field (ActiveInThisDB) after the username, if the username is there a will remove it.
Sub Queryclose(Source As Notesuidatabase, Continue As Variant)
Dim wks As New NotesUiWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim SearchView As NotesView
Dim activeDoc As NotesDocument
Dim docColl As NotesDocumentCollection
Dim item As notesitem
Dim result As Variant
Dim test As String
Set db = session.CurrentDatabase
Set SearchView = db.GetView( “(CheckActiveUser)” )
Call SearchView.Refresh
Set docColl = searchview.GetAllDocumentsByKey(“Active”)
If docColl.Count > 0 Then
Set activeDoc = docColl.GetFirstDocument
While Not activeDoc Is Nothing
userName = session.UserName
Set item = activeDoc.GetFirstItem(“ActiveInThisDB”)
'############################################################################################################
txtEvaluate = |@Trim(@Replace(| & item.values & |;| & userName & |;| & “”“” & |))|
'############################################################################################################
result = Evaluate(txtEvaluate, activeDoc)
activeDoc.ActiveInThisDB = result
Call activeDoc.Save(True,False)
Set activeDoc = docColl.GetNextDocument(activeDoc)
Wend
End If
End Sub
Kind regards
Fredrik