Run agent on web

i have to run an agent on web which set the status of current open document as well as the document which is alreadey saved my code is

Sub Initialize

'Dim wrk As New NotesUIWorkspace

'Dim uidoc As NotesUIDocument

Dim ss As New NotesSession

Dim db As NotesDatabase

Dim vw As NotesView

Dim doc As  NotesDocument

Dim documentID As Variant

Dim doc2 As NotesDocument

Dim dc As NotesDocumentCollection



'Set uidoc=wrk.CurrentDocument

Set doc=ss.DocumentContext

Set db=ss.CurrentDatabase

Print "Connecting to Excel..."

documentID=doc.MainID(0)

doc.edit_doc="y"

Print "Connecting to Excel..."

'serielno=uidoc.Document.srlno

'Set doc=uidoc.document





Set vw = db.GetView("All feedback")

Set dc=vw.GetAllDocumentsByKey(documentID,True)



Set doc2=dc.GetFirstDocument

While Not doc2 Is Nothing

	If doc2.status(0)="1" Then

		doc2.status="Old"

		Call doc2.Save(True,False)

	End If

	Set doc2=dc.GetNextDocument(doc2)

Wend





Call vw.Refresh

End Sub

when i calling agent on pressing a button then it shows the page cannot be displayed i got vary tanse what the problem where i did mistak please help me

regard

   rupesh

Subject: run agent on web

Hello Rupesh, You have proper access in the server to run the agent in WEB.

AS well as please check the agent property.

Pawan

Subject: run agent on web

Hello Rupesh,

As of my knowledge allways try to use following three Forms in your Database as you are developing Web based application.

1)$$ReturnAuthenticationFailure

2)$$ReturnAuthorizationFailure

3)$$ReturnGeneralError

You can get these Forms form Discussion db template. By Using these Forms you can track the reson of the error. It will diplay why the error came instead diplaying “Page can’t be displayed screen”.

Thanks,

Saswat

Subject: run agent on web

When you run this agent through web, all the errors related to this agent will be logged into log.nsf. If you check these errors and post here we can help you better. Most of the errors are self explanatory. First check the errors related to this agent in log.

Regards,

Ravi Kumar Thirukkovalur

Subject: run agent on web

Rupesh

You should be running this agent in the WebQuerySave event of your form, not an action button. This line:

Set doc=ss.DocumentContext

will take the agent as the document context, which means that there will be no fields.

Put the agent in the WebQuerySave event and add a submit button (you can use formula FileSave and Fileclosewindow).

Hope that helps

Ben