title: How to loop through all documents in a View of IBM Notes (NotesView) with Java
body: <p>I have a View with more than 2 documents inside. This is the code which grabs the document</p>
  
  <p>Currently I have this:</p>
  
  <pre><code>    Document orderRegelDocument = OrderRegelsVoorCopsView.getFirstDocument();
  while (orderRegelDocument != null) {
  //do something here
      System.out.println("Nieuwe Orderregel");
      tempOrderRegel = OrderRegelsVoorCopsView.getNextDocument(orderRegelDocument);
      orderRegelDocument.recycle();  // recycle the one we're done with
      orderRegelDocument = tempOrderRegel;
  
  }
  </code></pre>
  
  <p>The first document is getting grabbed but after that I get a NotesException: Notes error: Entry not found in index viewName. What am I doing wrong?</p>
  
  <p>And also a question next to this. If a user is in a document, but my agent also changes a field then when the user saves the document it gets a save conflict. Is there a  way to overcome this.</p>