I have devised a workaround to this.
If I use getAllEntriesByKey() I can use getCount() to know how many entries there are. Call this 'docsinview'.
I then use GetAllEntries() and iterate through the entries until I find the first entry that matches. Call this 'start'. I use this value as the Starting Index for the datatable and then use docsinview as the Repeat Limit of the datatable.
Not ideal, but it now works as I want it to:
Code for Starting Index:
var v = database.getView("Attachments");
var allvc:NotesViewEntryCollection = v.getAllEntries();
var start:Integer = 0;
var entry:NotesViewEntry = allvc.getFirstEntry();
while (entry != null){if (entry.getUniversalID()== "BC846CCFDA41303180257B35003FE0C5"){
break;}
else{entry = allvc.getNextEntry();
start = start + 1;
}
}
return start
Code for Repeat Limit:
var v = database.getView("Attachments");
var vc:NotesViewEntryCollection = v.getAllEntriesByKey("BC846CCFDA41303180257B35003FE0C5");
var docsinview = vc.getCount();
return docsinview