Can't see the Value of a Field using documentcontext - SOMETIMES

Hi All,

I have an agent I am calling from the web using the OpenAgent? sytax. When I call the agent I need to get hold of the database name, which I store in a computed for display field. The bizarre thing is that the field is in a subform which I have used elsewhere without any trouble. But it seems to be inconsistent. I have another form which includes the very same subform, but am not able to access any field values using the following syntax:

Set doc = session.DocumentContext

Messagebox doc.ThisDBW(0)

The forms are both set up the same ie generate html for all fields is set. Furthermore, I can see that the forms have values assigned if I view the source of the page generated.

Both forms are called using the ?openform syntax.

Any suggestions would be much appreciated.

Regards,

Terry

Subject: Can’t see the Value of a Field using documentcontext - SOMETIMES

How are you calling the agent?

Subject: RE: Can’t see the Value of a Field using documentcontext - SOMETIMES

I am using the following sytax:

location.href = “/” + f.ThisDBW.value + “/Query_Loader?Openform&Query=Web_Transfer_Year?OpenAgent&corpsid=” + f.corpsid.value + “&FromYear=” + fromYear + “&ToYear=” + toYear

This opens the form Query_Loader which then has the following code in the HTML Head content to call the agent:

OpenURL :=@ReplaceSubstring(Query;" "; “+”);

“<META http-equiv="refresh" content="5;URL=” + OpenURL + “">”

Subject: RE: Can’t see the Value of a Field using documentcontext - SOMETIMES

Where are you getting/setting the value of “Query” for your formula?

Subject: Can’t see the Value of a Field using documentcontext - SOMETIMES

The context document for an agent is the http request for the agent, not the form you used to generate the URL to request the agent. You need either to feed the DB name to the agent in the URL or (if the agent is in the same database), generate the web db name from context.Server_Name(0) and context.Path_Info(0).