I have an agent that I wrote a while ago that just returns an email address using @DbLookup. Its basically just a database with email addresses and a few views, nothing really complex. I wanted to know if I could return a value from that agent in a QuerySave I’m writing in LotusScript. The original agent is in Formula language. Can this be done?
I have tried rewriting the code in LotusScript , however, I can’t get it to work. I have posted the code below. It only returns a type mismatch error.
Dim session2 As New NotesSession
Dim dbPrefManu As NotesDatabase
Dim workspace As New NotesUIWorkspace
Dim classview As NotesView
Dim uidoc As NotesUIDocument
Dim doc2 As notesdocument
Dim key As String
Dim email As String
key = supplier_name
Set uidoc = workspace.CurrentDocument
Set dbPrefManu = session2.GetDatabase("srv-notes4/Adtran1", "practice\TestPreferredParts.nsf")
Set classview = dbPrefManu.GetView("Mfr Master")
Set doc2 = classview.GetDocumentByKey(key)
email = doc2.GetFieldText("Email_Add")
Msgbox "Email:" & email