On the mdc.nsf (mobile directory catalog) Im trying to create a NotesViewEntryCollection and run through the entries but after I get the first entry it says “Entry is no longer in view”
Dim s As New NotesSession
Dim db As New NotesDatabase(s.CurrentDatabase.Server,"MDC.nsf")
Dim mdcView As NotesView
Dim mdcCol As NotesViewEntryCollection
Dim mdcEnt As NotesViewEntry
Set mdcEnt = mdcCol.GetFirstEntry
test = mdcEnt.ColumnValues(0)
msgbox test
it fails on the test = line. If anyone else gets to try this let me know how it goes.
Dim db As New NotesDatabase(s.CurrentDatabase.Server,“MDC.nsf”)
Dim mdcView As NotesView
Dim mdcCol As NotesViewEntryCollection
Dim mdcEnt As NotesViewEntry
Set mdcEnt = mdcCol.GetFirstEntry
test = mdcEnt.ColumnValues(0)
msgbox test
[/code]
But… you’re dimming the variables as new objects but you’re not doing anything with them. First you’re going to need to call a function to actually get the view you want from the db, and assign that to your mdcView variable. Only after that can you start getting entries from columns and such.
BTW… choosing the view will be an easy thing… the only view available to you in a condensed directory catalog is the $Users view. That’s the only view that’s built on-disk. Because of the special, compressed nature of a CDC, all other views that you see (when you actually open the db) are built on-the-fly by the dircat code.
Not necessarily related to this post, but I was having the same error when I tried to get a viewEntryCollection with getAllEntiresbyKey:
Entry is no longer in view:[Name of View]
The problem was that I was using a categorized view, rather than a “flat” view. Apparently the first entry it got was the category entry, not the first document.
The strange thing was this LotusScript ran correctly, and sometimes I got the error. I converted the view to a non-categorized view.
If you got here by Googling “entry is no longer in view” and you are getting this error while iterating through a view entry collection created after a NotesView.FTSearch call, take a look at this technote.
Added note: I got the error using GetNextEntry, so it appears to affect more than just GetNthEntry as the technote suggests. A workaround is to get the NotesView.AllEntries collection from an unfiltered NotesView, then do a NotesViewEntryCollection.FTSearch call.