hcl-bot
November 30, 2006, 10:48am
1
I have a LS Agent that runs on the server. Currently it sends an e-mail containing a doclink to several documents within the database.
The user wants to change this to a url link instead and I’m having problems getting the server name. I am trying to format the url with the following line of code:
url=“http://” & dbserver(0) & “/” & dbname(0) & “/” & docid(0) & “?OpenDocument”
The result I get in the e-mail does not include the server name:
http:///webpres/PRODUCTT.NSF/CEF6EC8B372AD6E386257228004D9CF5?OpenDocument
Can someone point me in the right direction?
Thanks,
mary
hcl-bot
November 30, 2006, 10:53am
2
Subject: Getting the url in server-run agent …
How / where are you setting dbserver(0)?
hcl-bot
November 30, 2006, 11:26am
3
Subject: RE: Getting the url in server-run agent …
Here’s the code:
dbname = Evaluate({@WebDbname })
dbserver = doc.Server_Name
docid = Evaluate({@Text (@DocumentUniqueID )},doc)
I have also tried using:
This gives me the Notes Server name ==>
dbserver = Evaluate({@Subset (@Dbname ;1)},doc)
This one gives me a blank ==>
dbserver = Evaluate({@GetHTTPHeader (“Server_Name”)}, doc)
hcl-bot
November 30, 2006, 11:30am
4
Subject: RE: Getting the url in server-run agent …
Did you try something like:
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
dbserver = db.Server
Is Doc.Server_Name defined as a field on the form and have a value in it? It should probably be Doc.ServerName(0)
hcl-bot
November 30, 2006, 11:47am
5
Subject: RE: Getting the url in server-run agent …
Tom, I tried your suggestiona nd that still gives me the Notes Name for the server and not the “www.xxx.com ” like I need.
hcl-bot
November 30, 2006, 11:56am
6
Subject: RE: Getting the url in server-run agent …
Put an editable hidden field on your form and name it HTTP_Host (this is a reserved CGI variable) and reference it via
Doc.Http_Host(0) - dont forget the (0)
hcl-bot
November 30, 2006, 12:03pm
7
Subject: RE: Getting the url in server-run agent …
No difference in the results. I’m still getting a blank.
Thanks for your help – I appreciate it.
hcl-bot
November 30, 2006, 12:06pm
8
Subject: RE: Getting the url in server-run agent …
Did you put a default value of Http_Host for the field? It could be your browser is caching this info as well.
Is there anything in the field named http_Host? It should default to the server name.
hcl-bot
November 30, 2006, 12:14pm
9
Subject: RE: Getting the url in server-run agent …
no default value in HTTP_Host.
Won’t that just pick it up if the document happens to be open in the browser? This is the server agent looking at the document.
hcl-bot
November 30, 2006, 2:15pm
10
Subject: RE: Getting the url in server-run agent …
To get the server name without the hierarchal components of the name use
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim servername as new NotesName(db.Server)
url=“http://” & servername.Common & “/” & dbname(0) & “/” & docid(0) & “?OpenDocument”
hcl-bot
November 30, 2006, 6:43pm
11
Subject: Getting the url in server-run agent …
Hello Mary,
According to a message posted in the CodeBin on OpenNTF ( http://www.openntf.org/Projects/codebin/codebin.nsf/CodeSearch/B9DF92D8E753349688256BDC000CC1B5 ) there is a hidden NotesSession property called “InternetHostName”.
Try that instead of dbserver(0).
Good luck,
Marleen