Hello Forum, hope someone can help me with this one.
I have created a agent to do a lookup from the web but I can not get a handle on the values -
Could someone assit me in this agent.
Sub Initialize
Dim session As NotesSession
Set session = New NotesSession
Dim ldb As NotesDatabase 'Lookup up database
Dim view As NotesView '
Dim doc As NotesDocument
Dim ldoc As NotesDocument
Dim key As String
Set doc = session.DocumentContext
' Print session.UserName & "<br>"
Set ldb = New NotesDatabase("ServerName","admin\myscan.nsf")
Print " ldb is working <br>"
Set view = ldb.GetView("(uname)")
Print "lview is working <br>"
Set ldoc = lview.getDocumentbykey("Troin Artis")
If Not ldoc Is Nothing Then
Print "I got a handle on the doc <br>"
'Print "Ldoc.databasefilepath<br> " & ldoc.databasefilepath
Print "ldoc.GetItemValue(DatabaseFilepath) <br> " & ldoc.GetItemValue("DatabaseFilepath")
Print "Ldoc.databasefilepath(0) <br> " & ldoc.databasefilepath(0)
Print
Else
Print "Can not get a handle on ldoc<br>"
End If
%REM
%END REM
End Sub
Subject: Lookup using LotusScript via the web
What are you trying to accomplish with this script and how are you calling it?
Subject: RE: Lookup using LotusScript via the web
Well this agent is part of a bigger picture - the agent looks into a database that has everyone user name and shows who has editor access to what database - it also shows the database path and title.
The code needs to pull data from the database to create dynamically links based on user editor access in the acl.
Subject: RE: Lookup using LotusScript via the web
and how/when is this called?
Subject: RE: Lookup using LotusScript via the web
What I am doing now is just testing to make sure I can get the values I need
I am calling it manual now
http://servername.com/db/GetUserDatabase?OpenAgent
Subject: RE: Lookup using LotusScript via the web
No, I mean how is the agent launched in the web side of the application?
Subject: RE: Lookup using LotusScript via the web
This is how I am calling it just for testing purpose.
I have no problem printing out values to the screen.
I have a handle on the database and the view.
I am calling it manually.
How should I be calling the agent for testing.
I have used this way to test web agents before and I got the value I needed.
For example the session.commonusername prints out
Subject: RE: Lookup using LotusScript via the web
You can find a lot of useful ideas on how to test agents (among other useful thigns)in the Agent FAQ. I would recommend starting with the article call “troubleshooting agents”.