Search code examples
viewlotus-dominolotusscriptagent

LotusScript getNextDocument quantity of documents


  1. I've a NotesView named "status" with selection: documentStatus = 0,
  2. I've an lotusscript agent which gets all document from "status" view and change the documentStatus value to 1.

After agent run the "status" view should be empty but there are documents which agent didn't process.

Were I made a mistake?

There is a Lotussript code:

Set doc = view.Getfirstdocument()
While Not ( doc Is Nothing)
    Set docNext = view.Getnextdocument(doc)
    Call doc.Replaceitemvalue("documentStatus", 1)
    Call doc.Save(True, True)
    Set doc = docNext
Wend

Solution

  • Start your code with a line

    view.AutoUpdate = false
    

    This prevents your view being refreshed during agent run.