Hello...
In an XPage, where "doc" is the currently 'loaded' document, in a button's action I would like to obtain a handle to the document that appears under the current in a certain view.
I use the following code, which is generating an error at the last line:
-----------
var v:NotesView = database.getView("ViewByYear");
var curDoc:NotesDocument = doc.getDocument();
// curDoc = v.getFirstDocument();
if (curDoc==null) return(false);
var nextDoc = v.getNextDocument(curDoc);
-----------
The error message is: Script interpreter error, line=11, col=32: [TypeError] Exception occurred calling method NotesView.getNextDocument(lotus.domino.local.Document) null.
if I uncomment the comment line (setting curDoc as the first document in the view), the error does not occur.
Any idea why this is happening? How is the document generated from the context different? This document comes anyway from this same view which is embedded on the same XPage.
Thanks for your insights