UPDATE: 01feb09 Installed Designer 7 on a virtual machine and I was able to run the agent manually. When I run the agent in LN8.5 then the following error pop's up.
Hello all,
For one reason or another the WebBoardIndexSchedule is not running smoothly. Agent gives the following error in the log: object variable not set.
31/01/2009 20:07:34 AMgr: Agent ('WebBoardIndexSchedule' in 'Database\WSC Alleman\Jeugdwer.nsf') error message: Object variable not set
Started running agent 'WebBoardIndexSchedule' on 31/01/2009 20:06:34
Running on all documents in database: 39 total
Found 39 document(s) that match search criteria
Ran LotusScript code
Done running agent 'WebBoardIndexSchedule' on 31/01/2009 20:06:36
Accoding to the LNscript debugger the problem lies here:
Set tmpdoc = entry.Document<br/>
I do not uderstand this, I've checked the full code and did not find discrepancies and I did not make any modification to the code.
Pls find here the full code:
Sub Initialize
<br/>
' This agent update the webboard index pages with document counts, last posts etc...<br/>
' Must be scheduled every x min on server (recommended value is 15 min)<br/>
<br/>
Dim s As New NotesSession<br/>
Dim view As NotesView<br/>
Dim viewcategories As NotesView<br/>
<br/>
Set db = s.CurrentDatabase<br/>
<br/>
Set viewcategories=db.GetView("(LookupCategories)")<br/>
viewcategories.AutoUpdate=False<br/>
Set view = db.GetView("WebBoardIndex")<br/>
view.AutoUpdate=False<br/>
<br/>
'first we loop thru all cat to see if some are now empty<br/>
Set doccategory=viewcategories.GetFirstDocument<br/>
Do Until doccategory Is Nothing<br/>
Set doc=view.GetDocumentByKey(doccategory.getItemValue("Category1"))<br/>
If doc Is Nothing Then<br/>
Call doccategory.ReplaceItemValue("MainCount","0")<br/>
Call doccategory.ReplaceItemValue("RespCount","0")<br/>
Call doccategory.ReplaceItemValue("LastSubject","")<br/>
Call doccategory.ReplaceItemValue("LastResponseDateServer","0")<br/>
Call doccategory.Save(False,False)<br/>
End If<br/>
Set doccategory=viewcategories.GetNextDocument(doccategory)<br/>
Loop<br/>
<br/>
'next we update counters for each categories<br/>
Set nav = view.CreateViewNav<br/>
Set entry = nav.GetFirst<br/>
<br/>
Do Until entry Is Nothing Or entry.IsCategory=False<br/>
<br/>
Set doccategory = viewcategories.GetDocumentByKey( Cstr(entry.ColumnValues(0)) , True)<br/>
If Not (doccategory Is Nothing) Then<br/>
Call doccategory.ReplaceItemValue("MainCount",Cstr(entry.ColumnValues(2)))<br/>
Call doccategory.ReplaceItemValue("RespCount",Cstr(entry.ColumnValues(3)))<br/>
Set entry = nav.GetNextDocument( entry ) <br/>
Set tmpdoc = entry.Document<br/>
tmp="<script>_wi2('"+ Cstr(tmpdoc.CreatedServer(0))+"','"+ HTMLEncode(Left$(tmpdoc.Subject(0),28) & " ..." )+"','"+_ <br/>
HTMLEncode(tmpdoc.Pseudo(0))+"','"+tmpdoc.UniversalID+"','"+ tmpdoc.MainUNID(0)+"','"+"')</script>"<br/>
Call doccategory.ReplaceItemValue("LastSubject",tmp)<br/>
Call doccategory.ReplaceItemValue("LastResponseDateServer",Cstr(tmpdoc.CreatedServer(0)))<br/>
Call doccategory.Save(False,False)<br/>
Else<br/>
Set doccategory = db.CreateDocument<br/>
doccategory.Form="Category"<br/>
doccategory.Category1=Cstr(entry.ColumnValues(0))<br/>
Call doccategory.Save(False, False)<br/>
End If<br/>
<br/>
Set entry = nav.GetNextCategory( entry ) <br/>
<br/>
Loop<br/>
<br/>
End Sub
Anu clue?
Thanks in advance!
T.