Xpages-调用方法NotesView.getNextDocument(lotus.domino.local.Document)null时发生异常

Xpages-调用方法NotesView.getNextDocument(lotus.domino.local.Document)null时发生异常,xpages,lotus-notes,lotus-domino,xpages-ssjs,ssjs,Xpages,Lotus Notes,Lotus Domino,Xpages Ssjs,Ssjs,我得到了上面的错误。 有没有办法检查下一个文档是否为空? 下面是我的代码: var vec:NotesView = database.getView("QueryNotes"); var queryColl:NotesDocumentCollection = vec.getAllDocumentsByKey(ProjectUNID,true); if(queryColl.getCount() > 0){ var queryDoc1:NotesDocument = queryColl.g

我得到了上面的错误。 有没有办法检查下一个文档是否为空? 下面是我的代码:

var vec:NotesView = database.getView("QueryNotes");
var queryColl:NotesDocumentCollection =   vec.getAllDocumentsByKey(ProjectUNID,true);
if(queryColl.getCount() > 0){
var queryDoc1:NotesDocument = queryColl.getFirstDocument();
while (queryDoc1 != null) {
    if(!queryDoc1.hasItem("QueryEndDate")){
        queryDoc1.appendItemValue("QueryEndDate", session.createDateTime(@Now()));

        var tmpdoc = vec.getNextDocument(queryDoc1); //error when next is null, or does not exist
        queryDoc1.recycle();
        queryDoc1 = tmpdoc;
      }
   }
}
应该有一种检查方法,类似的stackoverflow没有回答问题


期待您的响应。

您正在调用
vec
变量上的getNextDocument()(该变量是视图对象,没有该方法)。您应该改用
queryColl
变量。

您正在对
vec
变量调用getNextDocument()(该变量是一个视图对象,没有该方法)。您应该改用
queryColl
变量。

这是一个问题。另一个是在if语句中处理迭代(getNext,recycle…),这是一个问题。另一个是在if语句中处理迭代(getNext,recycle…)。。。