Solved

Agent behaving Strange !

Posted on 2003-12-09
24
568 Views
Last Modified: 2013-12-18
Hi guys


I have two databases, one copy of the other in two servers (say A and B).

IN the database i have a form and a webquerysave agent for that form . The webquerysave agent is able to get all the values in documentcontext in server A. but the same agent is not getting any values of documentcontext in server B

To tell u guys clearly ,a simple querystring display in two servers yield me different results

Assume the url is like this :test?openform&docid=3243432

the agent in serverA returns the query string as

OpenForm&Seq=1&docid=3243432


the agent in serverB returns the query string as
OpenForm&Seq=1

the cause of this problem which i am not trying to rule out is:

agent signer rights


but the ppl in server B claim that they relevant rights to run the agent


What else cud be the cause for documentcontext to be null in that server when the same are displayed in server A


Thanks guys
Partha







0
Comment
Question by:p_partha
  • 11
  • 7
  • 6
24 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9908694
1. Is this notes form/page
2. Do you have full passthru html
3. Is treat contents as html enabled ?

If you view source in html then the document content is enclosed in FORM tags ? If not then this could be a problem..

If you view sources for form A and form B .. they look same ??

Also these kind of  problems ca arise due to some incompatibility issues with DSAPI filters.. not sure if Server B uses one like that.. and anyother third party software that you might want to consider..

~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9908704
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9909160
Wait, if DOcumentContext was null, then the agent on server B wuld not report back query string as OpenForm&Seq=1!  It would fail with Object Variable Not Set!

try this for tesing purposes.  Temporarily add a visible, editable field to the form, named ContextCheck, with a default value of: @Unique + " " + @Text(@Now)

In your agent, just below the line that says something like set doc = s.documentcontext,  want you to add:
If doc Is Nothing Then
  MsgBox "No document context!"
Else
  MsgBox doc.noteID & "." & doc.universalID & " ContextCheck: " & doc.ContextCheck(0)
End If

Now, have someone work through the form on server B, note the value of the context check field.  You can then look in Misc Events in the log, to see what the agent reported.
0
 
LVL 14

Author Comment

by:p_partha
ID: 9909278
Hemanth,
It's a normal form, with generate html for all fields enabled.

Good point, i will check with them whether they are using any DSAPI filter. If at all they are using, what is the alternative for me.

Qwalette,
Since my agent was failing, i tested with a dummy form with webquerysave agent, and printed just doc.query_string(0)
will try ur alternatives and get back on the result

But guys any ideas what is the alternative apart from using openagent , if my documnet context is failing,

THx guys

Partha
0
 
LVL 14

Author Comment

by:p_partha
ID: 9909300
Also is this anyway related to "having rights with running agents"... or some thing related at server documnet level, as it is working in our development server.

One more point, the server B is a cluster server


Partha


0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9909582
f the agent runs at all, then it has some level of rights.  If it is doing anything rights-wise that cause it to terminate prematurely, you can probably catch it with On Error.

You can also create a global integer variable named terminatedNormally.  In your Terminate event, add:

If terminatedNormally
  MsgBox "Hapilly ever after"
Else
  MsgBox "Abend!"
End If

Then, at the end of you regular initialize code, do a terminatedNormally=True (and anywhere else you have an exit sub in Initialize or an end statement anywhere)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9909598
Please also note that I find...

OpenForm&Seq=1&docid=3243432

...odd.  &Seq=1 is used when a user presses a button/action that does not close the form (simple refresh or file save or field-change formula).  Notes appends the &Seq so that the browser will not use a cached copy of te page.

So, why would &docid ever appear? Did you open teh form originally by URL, with this parameter?  Does that parameter actually appear in the URL when teh agent "fails?"  Or could it be that the agent is fine, but whatever mechanism you are using to add the QS parameter is behaving differently on the two servers, and the agent issue is a symptom, not a direct exhibition of the problem?
0
 
LVL 14

Author Comment

by:p_partha
ID: 9912636
Qwalette,
This is my original URL before i submit the document

http://<servername>/rater/Rater.nsf/pp.test?OpenForm&docid=3423432423


i have a submit button and webquerysave agent

The agent is this code

      Dim session As New notessession
      Dim doc As notesdocument
      Set doc = session.documentcontext
      If Not doc Is Nothing Then
            Print doc.Query_String(0)
      Else
            Print "doc is nothign can't do anything"
      End If



The url after submission changes to http://<servername>/rater/Rater.nsf/pp.test?OpenForm&Seq=1

and output of the agent is

OpenForm&Seq=1

I am confused here

Partha




0
 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 100 total points
ID: 9913077
That is right.. Print will write a new content .. and domino recognizes that as a refresh..and adds &seq=1.. The problem is with the agent.. don't print it rather set the value of the field in the form for testing.

eg:

doc.Test = doc.Query_String(0)

or create field Query_String in the form and it will display the correct value
0
 
LVL 14

Author Comment

by:p_partha
ID: 9913473
Hemanth,

I was not printing the value, that is only for testnig purpose, but as i said, query_string is getting only &seq=1, so
&docid=3243432 which was also sent is lost. So i cannot get the value of the docid and my agent is failing , but the strangest part it is the same agent is working in couple of our development servers it is able to get the value of docid in query_string


Partha
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9913538
for testing purpose include query_string field in the form .. and see if it reflects the value properly. ALso is this in frame
0
 
LVL 14

Author Comment

by:p_partha
ID: 9913546
I have already added query_string in the form hemanth, is there any server document level settings....


Partha
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9913559
It is nothing to do with configurations !!
0
 
LVL 14

Author Comment

by:p_partha
ID: 9913728
Why i am asking u this becoz, the same agent is behaving differently in two servers. IN server A and in all my development servers, it is fetching the querystring with the docid, but in the server B it is fetching the value of querystring as openform&seq=1 .


Hope i am clear

Partha


0
 
LVL 31

Accepted Solution

by:
qwaletee earned 150 total points
ID: 9914874
Actually, I'm a bit confused.  WHat is teh user clicking on that causes teh doc to save?  If I put in a button that just says @COmmand([FilseSave]), then my WQSAgent runs, but the resulting URL is a ?CreateDocument URL, and thatis the query string value my agnet prints out.  So, teh agent sees the RESULT URL, not the URL that was displayed before the user clicked whatever button/action used to submit.

In other words, the fact that yuo see a ?OpenForm URL tells me that either you have something else in the "save button," or a $$Return that is redirecting to an ?OpenForm URL, which is unlikely given that there's the typical Domino &Seq=1.
0
 
LVL 14

Author Comment

by:p_partha
ID: 9915132
Qwalette, i will try to be clear.

I have a submit button on a form -- javascript --> document.forms[0].submit()

i have a webquerysave  -->@Command([ToolsRunMacro]; "pp.test")

No $$return

Agent code:

Dim session As New notessession
      Dim doc As notesdocument
      Set doc = session.documentcontext
      Print "Hai"
      If Not doc Is Nothing Then
            Print doc.query_string(0)
      Else
            Print "doc is nothing "
      End If



The url to the form is like this :

http://<servername>/rater/Rater.nsf/pp.test?OpenForm&docid=3423432423


When the submit button is clicked in server A , the url changes to
http://<servername>/Rater.nsf/pp.test?OpenForm&Seq=1&docid=3432432



The same code and the same url in server B , the url changes to
http://<servername>/Rater.nsf/pp.test?OpenForm&Seq=1

So when i see the querystring docid is not there...

Hope i am clear

Partha







0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9915606
I say it is not the normal stuff.. something is setting the docid back..while submit

Usually when this is the url

http://<servername>/Rater.nsf/pp.test?OpenForm

then after submit it will be
http://<servername>/Rater.nsf/pp.test?OpenForm&Seq=1

In your case if the initial url is
http://<servername>/rater/Rater.nsf/pp.test?OpenForm&docid=3423432423

Then after submit it would be
http://<servername>/Rater.nsf/pp.test?OpenForm&Seq=1

So check the FOrms in both the server for any javascript functions manipulating location object
0
 
LVL 14

Author Comment

by:p_partha
ID: 9915633
no Hemanth,

you can check, if ur URL IS of this format
http://<servername>/rater/Rater.nsf/pp.test?OpenForm&docid=3423432423 then after submit it becomes like this:

http://<servername>/rater/Rater.nsf/pp.test?OpenForm&seq=1&docid=3423432423

I am sure on that.... otherwise we cannot use querystring in the code itself...


since the datbaase is a copy of hte other there is no change
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9915667
for a test can you try a simple form with one field and manually add docid at the end of the url

I am pretty sure that seq=xx is always appended by domino far right of the url !
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9915676
Nope, I get what your server B does, and I created this as simply as possible:

Create agent:
Sub Initialize
      Dim s As New notesSession
      Dim doc As notesDocument
      Set doc = s.documentContext
      If doc Is Nothing Then
            Msgbox "============= NO CONTENT ==============="
            Print "============= NO CONTENT ==============="
            End
      End If
      Forall item In doc.items
            Msgbox item.name & "=" & item.text
            Print item.name & "=" & item.text "<BR>"
      End Forall
End Sub

New form, one subject field
Add QUERY_STRING field, CFD, text, value QUERY_STRING
Create button, set to run JS, document.forms[0].submit()
Set WQS to run above agent

Put in URL of above form, ?OpenForm&testitout

Results:
Subject=js submit!!!!!!
QUERY_STRING=CreateDocument
Form

Now, if I add a button with @Command([ViewRefreshFields]), and click the refresh button followed by the submit button, I get:
On refresh: the URL changes from ?OpenFOrm&somejunk to ?OpenForm&Seq=1
Notice that the extra parameters in the original query string are dropped on refresh.

Here's what I wonder: Are the two servers at the same version of Domino?  Perhaps some versions keep all parameters on refresh, and some do not.  Server B does not, server A does.  You have a refresh of some sort (not necessarily view [viewrfershfields]), and after that the user submits.
0
 
LVL 14

Author Comment

by:p_partha
ID: 9916258
Very Good point Qwalette, the server A is 5.0.11 and server B is 5.0.9... So that might be the problem right...

if yes then i will increase the poitns and give it to u and hemanth...

thx as always..

partha
0
 
LVL 14

Author Comment

by:p_partha
ID: 9916343
Guys
Is there any link where lotus documents what are the new additions/deletions from server 5.0.9a to 5.0.11 version...

Thx
Partha
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916672
Ha ha ha ha ha ha ha!

Release notes are suposed to.  Theyd on't always really cover it, and nobody but nobody really wants to read them.
0
 
LVL 14

Author Comment

by:p_partha
ID: 9916727
The problem  is If i ask these guys to upgrade to 5.0.11 and this doens't solve the problem, then i will be jacked.. anyways will give a try.. thx bro.....


Partha
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now