Hello,
I am looking to set a scheduled agent to run daily that will refresh all documents in a view but the @command([toolsrefreshalldocs]) doesn’t run as a scheduled task but works if you run this manually.
The problem is that the fields in the docs are NOT computed and have formulas that update the hidden editable fields. so this lotus script will not work:
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim success As Variant
Set db = session.CurrentDatabase
Set view = db.GetView(“ViewName”) ’ Get the all the docs in the view called ViewName
Set doc = view.GetFirstDocument ’ Get the first document in the view
While Not (doc Is Nothing) ’ Continue while there is a document available
success = doc.ComputeWithForm (False, False) ’ Refresh the document - updates computed fields
If success Then ’ ComputeWithForm method returns true if there are no errors during refresh
Call doc.Save (True, True) ’ Save document to disk
End If
Set doc = view.GetNextDocument(doc) ’ Get next document in the view
Wend
End Sub
Is there a way of utilising the @command([toolsrefreshalldocs]) within a Lotus script that will run as a scheduled agent and update the docs??
even if it just was to open them all, save and then close them all.
Please help.