Manage Learn to apply best practices and optimize your operations.

Refresh Views Via Agent

I wrote this code snippet for a VERY large database. To keep the response time
up (updates to the data were minimal), we set all views to Manual indexing.
This agent updates primary views first, then does all of the remaining views.
I call it hourly, when the agent dies during a run it just resumes the same
view later, by virtue of the other views already being updated and being quick
to finish the second time around.
Change the names of the "MainViews" variable to your own primary views, and
change the number if desired as well. Enjoy.
Sub RefreshViews( All As Variant )
' If all is true, all views are updated. If false, only the Main views
are updated.
' Refreshes Main views first...
Dim MainNames ( 5 ) As String
Dim view As NotesView
Dim Db As NotesDatabase
Dim session As New NotesSession

Set Db = session.CurrentDatabase

MainNames( 0 ) = "MultiSort"
MainNames( 1 ) = "byCertifier"
MainNames( 2 ) = "ByFilename"
MainNames( 3 ) = "Multisort Resp"
MainNames( 4 ) = "ID"
MainNames( 5 ) = "$UserName"

Forall viewname In MainNames
Set view = Db.GetView( viewname )
If Not ( view Is Nothing ) Then
Call view.Refresh
End If
End Forall

' After finishing updating the Main views, update ALL views if we wish to...
' Duplicate views to the Main views will be VERY quick, so don't worry about

If All Then
Forall otherview In Db.Views
If Not ( otherview Is Nothing ) Then
Call otherview.Refresh
End If
End Forall
End If
End Sub

Dig Deeper on Lotus Notes Domino Administration Tools



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...