CGI Variables

Hello all,

I have a web form that uses a Hotspot Resource Link with the following code.

http://notesapps.abc.com/dev.nsf/clientInfo?OpenAgent&quickSearch&“+@Text(fieldName)+”

The link calls the agent clientInfo and passes the actionType which is “quickSearch” and also the value of the field fieldName.

The agent’s code is as follows:

Dim session As New notessession

Dim contentDoc As notesdocument

Dim db As notesdatabase

Dim queryStringAs String

Dim parseCGI,fName,actionType As Variant

Set db = session.currentdatabase

Set contentDoc = session.documentcontext

queryString = contentDoc.query_string(0)

parseCGI = Split(queryString, “&” )

actionType=parseCGI(1)

fName= parseCGI(2)

print "The first name is: " + fName

This code works fine. The print fName prints the value of the computed field fieldName with default value “David”.

However, if the field fieldName is in edit mode and I enter a text value, the URL Link:“http://notesapps.abc.com/dev.nsf/clientInfo?OpenAgent&quickSearch&“+@Text(fieldName)+”” sends the @Text(fieldName) as empty and thus my agent’s code reads fName= parseCGI(2) as empty and only prints "The first name is: "

Can anyone tell me how I can pass a dynamic field value to my agent using the Hotspot Resource Link.

Thank-you

Subject: RE: CGI Variables

If you look at the HTML using View Source, I think you will see that the Domino server computed the URL for the hotspot link when the document was opened. At that time, of course, your field did not contain a value. Since the browser doesn’t know how to execute Lotus macro code, there is no way to make the browser evaluate your formula and insert your new field value.

Instead, for edit mode you need to use an action hotspot with “JavaScript” as the selected language (don’t forget to select client “Web”), and write JavaScript code to read the field value, insert it into a URL, and use location.href, location.replace, or window.open to navigate to that URL.