Greetings,I am trying to code a agent script that goes through a set of documents in a view, looks at a approver field on the document, then tries to lookup that data in another database view to return the lookup value but i keep getting a
“Variant does not contain a container”
for example the value i am looking up is
“CN=Ron Graham/OU=AU/O=Heatcraft” stored in field Approvers
the code is
Sub Initialize
Dim session As New NotesSession
Dim view As NotesView
Dim currdoc As NotesDocument
Dim nextdoc As notesdocument
Dim doc As notesdocument
Dim approvername As String
Set db = session.currentdatabase
Set view = db.getview(“viewofdocumentstocheck”
Set currdoc = view.GetFirstDocument
While Not(currdoc Is Nothing)
approvername = currdoc.Approvers(0)
Msgbox "the approver for this document is - "& approvername
eval = Evaluate ({@DbLookup(“”:“NoCache”;“CA257170:0008A76F”;“vw-ALLemployeeNameCheck”; approvername;2)},doc)
Msgbox eval(0)
Set nextdoc = view.GetNextDocument(currdoc)
Set currdoc = nextdoc
Set nextdoc = Nothing
Wend
Exit Sub
The first messagebox command returns the correct value, ie
CN=Ron Graham/OU=AU/O=Heatcraft from the document
yet the lookup is not returning the lookup value as i get the variant does not contain a container error.
The lookup view does have CN=Ron Graham/OU=AU/O=Heatcraft in it.
I noticed however if i change the eval line to have the keyword specifically it does return the lookup value
eval = Evaluate ({@DbLookup(“”:“NoCache”;“DATABASEID”;“lookupviewname”; “CN=Ron Graham/OU=AU/O=Heatcraft”;2)},doc)
Any ideas on how i can get this to work as it cycles through the documents?