I have a scheduled Java agent that cycles through the documents in a view. It updates a field in the doc, then saves the doc. I have taken care to retrieve the next doc in the view BEFORE saving the changes to the doc, as the changes made to the doc would cause it to disappear from the view. My code is as follows:
Document doc=view.getFirstDocument();
Document nextdoc=view.getFirstDocument();
while (doc!=null){
//changes made to doc here
nextdoc=view.getNextDocument(doc);
doc.save(true,true,false);
doc=nextdoc;}
Yet, I’m still getting a “Document argument is null” error when the agent runs out of docs to process in the view:
06/22/2004 13:55:15 AMgr: Agent (‘PostAgreementProcessing’ in ‘test/ecashierv3.nsf’) error message: NotesException: Document argument is null
06/22/2004 13:55:15 AMgr: Agent (‘PostAgreementProcessing’ in ‘test/ecashierv3.nsf’) error message: java/lang/Throwable.()V+4 (Throwable.java:73)
06/22/2004 13:55:15 AMgr: Agent (‘PostAgreementProcessing’ in ‘test/ecashierv3.nsf’) error message: java/lang/Exception.()V+1 (Exception.java:24)
06/22/2004 13:55:15 AMgr: Agent (‘PostAgreementProcessing’ in ‘test/ecashierv3.nsf’) error message: org/omg/CORBA/UserException.()V+1 (UserException.java:25)
06/22/2004 13:55:15 AMgr: Agent (‘PostAgreementProcessing’ in ‘test/ecashierv3.nsf’) error message: lotus/domino/local/View.getNextDocument(Llotus/domino/Document;)Llotus/domino/Document;+24 (:??)
I’ve searched this forum, and found a couple of other suggestions, which I’ve implemented to no avail:
-
I changed the indexing on the view to “Manual”,so the index on the view wouldn’t update during the time this agent is running
-
I tried using ViewNavigator to traverse through the docs in the view. This results in a different error: “Entry not found in index”.
Does anyone have any other suggestions? I’ve done a lot of LotusScript, but am new to Java. Thanks !!