Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

No QUERY_STRING in Session.DocumentContext (LotusScript)

147 views
Skip to first unread message

pawel.s...@gmail.com

unread,
Apr 2, 2008, 7:51:26 AM4/2/08
to
Hi there,

I'm trying to adapt the agent show at
http://mdm-adph.blogspot.com/2006/08/using-ajax-as-web-edit-protection_14.html
to my needs.
Anyways, when I try to use QUERY_STRING it results in "error: Object
variable not set" on the server console. When editing it in the
Designer 7, code assist doesn't even show Query_String as an
alternative...

Any ideas what could cause the problem?

Kind regards,
PS

Karl-Henry Martinsson

unread,
Apr 2, 2008, 1:17:08 PM4/2/08
to
<pawel.s...@gmail.com> wrote in message
news:b3def37d-30b3-414b...@s50g2000hsb.googlegroups.com...

Could you post some more code, and describe how you call the agent?

Just a few days ago, I posted a blog entry at (you can get to it through
http://www.planetlotus.org/1b0fd1) about parsing URLs in Lotusscript. I
even have a class there that will help you parse the URL parameters very
easily.

/Karl

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
=============
Visit my blog at http://www.bleedyellow.com/blogs/texasswede/

pawel.s...@gmail.com

unread,
Apr 3, 2008, 5:44:54 PM4/3/08
to
On 2 Kwi, 19:17, "Karl-Henry Martinsson" <use...@martinsson.us> wrote:

Hi Carl, thanks for your reply :)

> Could you post some more code, and describe how you call the agent?

Actually, I have discovered that it's not an issue associated with the
QUERY_STRING CGI variable, but rather the object itself -
DocumentContext.
The code is available on the blog entry I have provided link to above.
I call this agent using an AJAX call. Actually, even when providing
the link directly to the browser, it still gives the same result -
"error: Object variable not set".
When I rewrote the agent (for now only part of it) in Java, I can
easily access the QUERY_STRING variable... but I still don't know
what's wrong with the code provided on that blog entry.

> Just a few days ago, I posted a blog entry at (you can get to it throughhttp://www.planetlotus.org/1b0fd1) about parsing URLs in Lotusscript. I


> even have a class there that will help you parse the URL parameters very
> easily.

Thanks a lot! This will be useful for sure in the future. I have
already bookmarked this blog entry in my browser.
BTW, poor car... :)

BR,
PS

>
> /Karl
>


Karl-Henry Martinsson

unread,
Apr 4, 2008, 4:11:46 PM4/4/08
to

<pawel.s...@gmail.com> wrote in message
news:9ac4521f-64b6-4436...@k13g2000hse.googlegroups.com...

I notice something in your code... You don't define queryString, UNID
and remoteUser as strings, but as variants. Not best practice. But
should not cause your problem.

I copied the beginning of your code into an agent in a database on one
of my servers:

Sub Initialize
'**********************************************
' Checks to see if a document is currently being edited
' by checking the status of a lock stub belonging to a certain UNID
'
' Original idea from Scott Good of Lotus Advisor Magazine
'**********************************************

'Create variables
Dim Session As New NotesSession
Dim Doc As NotesDocument
Dim queryString, UNID, remoteUser
Dim allowEdit As Integer
Dim timeInterval As Integer

'Assign values to variables
Set Doc = Session.DocumentContext
allowEdit = True

'Set "timeInterval" to how long, in seconds,
'you want to lock a document
timeInterval = 90

'Grab UNID and remoteUser from the URL Query String
queryString = Doc.Query_String(0)
Print "queryString = " & queryString
End Sub

Worked fine, the URL
http://dstest/claimsystem/claimcaretimesheetentries.nsf/TestURL?OpenAgent&Foo=1&Bar=2
gave me the output queryString = OpenAgent&Foo=1&Bar=2

Try to insert print statements in your code to output HTML and display
the values of different variables.

/Karl


PS. Yeah, sucks with the car. But Geico were on top of things, I had a
rental car within 3 hours...

0 new messages