Refreah docs in a hidden view

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.

Subject: refreah docs in a hidden view

Why don’t you just perform the calculations in the script? Ignore the form.

Subject: RE: refreah docs in a hidden view

I don’t know Lotus script that well and mainly because there are so many fields with lots of IF statements and code the auto script would be too long and complicated.

Is there no other way around just refreshing all docs in that view??