xpages-异常发生呼叫方法notesview.getnextdocument(lotus.domino.local.



我会遇到上述错误。有没有办法检查下一个文档是否为null?以下是我的代码:

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变量。

最新更新