Hi,
I have a notes db which I want to give users read only access to via the web.
The web users access pre-created documents in the db, which contain a html form with several fields (pass through html).
The idea is that the user completes the form and then triggers an agent which is run as an administrator of the db (via the “Run as Web User” agent property).
This agent then reads the values entered by the user and does other stuff.
The problem I am having is how to trigger the agent so that it can then read the form completed by the user.
I don’t really want to pass the values to the agent as parameters. e.g http://db.nsf/agentname?runagent&parm1=firstname&parm2=lastname
I want to maintain the doccontext for the agent to read… can it be done?.
As it is a document and not a form can I get js to submit the form and trigger the WQS event?
a pro-type demo is at : http://www.obos.co.uk
Subject: Web : Can you runagent & maintain documentcontext ??
You need to have control of the tag so you can use:
Post data can be parsed out of the Request_Content field of the context. (You don’t get the easy way, like contextDoc.Fieldname, unless you actually have a Designer form to post to.) It would be a very rare circumstance that wouldn’t allow you to have a Designer form rather than user-created ad hoc forms. (And running the agent with an Admin id is taking a big chance. It would be far better to create an “ordinary user” id that can run agents with reduced rights.)
Subject: RE: Web : Can you runagent & maintain documentcontext ??
Hi Stan,
Thanks for the advice.
The HTML form I have is called ‘yourdetails’
it sits on a notes form called reserve.asp
It triggers the agent
‘(agReserveItem)’
But I still can’t seem to get anything with the agent using:
Set doc = session.DocumentContext
Request_Content = doc.GetItemValue(“Request_Content”)
Am I confusing the issue? Thanks for any help.
Subject: RE: Web : Can you runagent & maintain documentcontext ??
You will find the request data in the zeroeth element of Request_Content:
Set doc = session.DocumentContext
Request_Content = doc.GetItemValue(“Request_Content”)(0)
This assumes that session, doc and Request_Content have been declared and that session has been set in code you haven’t included.
Why are you using a .asp extension? With Domino server commands, UNIDs and database filenames floating around, you won’t be fooling anybody…
Subject: RE: Web : Can you runagent & maintain documentcontext ??
Hi Stan,
I realised what I was doing wrong…
My submit button wasn’t doing what it should… this solved it.
I call the forms .asp just for consistency across the website as some pages are .asp some .nsf and some .htm/l
Ideally, I would prefer Apache to serve the pages and domino can sit as the back end.
Then they can all be html files which just makes it easier for users to remember, customers to remember their links and some search engines to index.
Although am reconsidering using pure html forms with domino as I prefer to trigger the WQS event so that the Remote_Content field is not required and therefore cannot be set by a
user manually.
http://www.codestore.net/store.nsf/cmnts/631A85BCEE89337986256BDD0048D70F?OpenDocument
Thanks Again… Alastair
Subject: Web : Can you runagent & maintain documentcontext ??
Hy Ali,
you could do following:
In your forms $$Return-Field, you could enter following:
“[/” + @WebDBName + “/yourAgent?OpenAgent&docid=” + @Text(@DocumentUniqueID) + “]”
Just call your Agent with the parameter DocID of the saved document.
Then in your Agent, you can read the DocID from the URL and get handle to this document (e.g. Set doc = view.GetDocumentByKey(DocIDfromURL)).
Once got handle to the document, you could do your stuff.
Ayhan