Scheduled Agent

I have an agent which I have scheduled on 11 PM daily.The code is as follows:


Sub Initialize

Dim db As NotesDatabase

Dim session As New NotesSession	

Dim doc1 As NotesDocument

Dim doc As NotesDocument	

Dim view As NotesView

Dim success As Variant



Set db = session.CurrentDatabase	

Set doc1 = db.CreateDocument





Set view = db.GetView("view1 for sap report1")

Call view.Refresh



Set view = db.GetView("view2 for sap report1")

Call view.Refresh



Set view = db.GetView("view3 for sap report1")

Call view.Refresh



Set view = db.GetView("view4 for sap report1")

Call view.Refresh



Set view = db.GetView("view5 for sap report1")

Call view.Refresh



Set view = db.GetView("view6 for sap report1")

Call view.Refresh



Set view = db.GetView("view7 for sap report1")

Call view.Refresh



Set view = db.GetView("abapview1")

Call view.Refresh



Set view = db.GetView("abapview2")

Call view.Refresh



Set view = db.GetView("basisview1")

Call view.Refresh



Set view = db.GetView("basisview2")

Call view.Refresh



Set view = db.GetView("it_view1")

Call view.Refresh



Set view = db.GetView("it_view2")

Call view.Refresh



Set view = db.GetView("it_view3")

Call view.Refresh



Set view = db.GetView("it_view4")

Call view.Refresh



Set view = db.GetView("it_view5")

Call view.Refresh



Set view = db.GetView("it_view6")

Call view.Refresh



Set view = db.GetView("it_view7")

Call view.Refresh



Set view = db.GetView("it_view8")

Call view.Refresh



Set view = db.GetView("it_view9")

Call view.Refresh



Set view = db.GetView("it_view10")

Call view.Refresh



Set view = db.GetView("COMMENTS")

Call view.Refresh



doc1.Form = "IT Overview Report"

'doc1.hidden_created= Cstr(doc1.Created)



success = doc1.ComputeWithForm( True, False )

If success Then

	Call doc1.Save( True, True )

End If

End Sub


It works when I manually run it and creates a form “IT Overview Report” but does not work schedulely.

Any tips?

Regards,

Aisha Ishrat

Subject: Scheduled Agent

There are couple of things that can cause this problem:

  1. check that database properties → Basic Tab “Disable background agents for this database” is unchecked

  2. You have rights to run schedule agents on server. To check this…Open Server document in Domino Administrator client, on security tab look for “Run restricted LotusScript/Java agents:” field. This field should contain either explicitly your name or any group and you must be member of that group.

  3. On Server console execute the following command “tell amgr schedule”, if this agent is scheduled, it will show next time when this agent will run.

Hope it will help resolving the issue.

Subject: RE: Scheduled Agent

Yups correct, I dont have the rights.

Thanks.

Regards,

Aisha Ishrat.

Subject: Scheduled Agent

Whats the error message in log.nsf