Problem with NotesViewEntryCollection class

I’m having a problem with the NotesViewEntryCollection class.If anyone can help I would greatly appreciate it. I’ve worked too long on this and have looked at help over and over but have had no luck.

First I’m using GetFirstDocument method. I get the doc, get a few fields value then create a new doc with those values.

Here is where I’m having trouble. After the doc is created, I need to look to a view for more info for the newdoc based on the getfirstdocument.

Everything works fine, the newdoc is created then sent, getsnextdoc, then sends that one too.

The problem is that the NotesViewEntryCollection isn’t getting values to place on the newdoc. Nothing happens with that whole section.

here is the code for the NotesViewEntryCollection


'before all this, get first doc and creates newdoc then looks in

another view for additional fields for newdoc

'…there is where I’m having trouble…

Dim ViewTwo As NotesView

Dim Ventry As NotesViewEntry

Dim VeCol As NotesViewEntryCollection

Dim DocTwo As NotesDocument

Dim key as Variant

key = DocOne.mykeyfieldname(0)

Set db = session.CurrentDatabase

Set ViewTwo = db.Getview(getviewtwo)

Set VeCol = ViewTwo.GetAllEntriesByKey(key, True)

Set Ventry = VeCol.GetFirstEntry()

While Not (DocTwo Is Nothing)

Set DocTwo = Ventry.Document

NewDoc.Name = DocTwo.Authors(0)

'…get more values

'…get more values

'…get more values

'…get more values

Set Ventry = VeCol.GetNextEntry(Ventry)

Wend

'this just returns to top to get the next doc, then proceeds to notesviewentry section for more info for newdoc to send.

Set DocOne = ViewOne.GetNextDocument(DocOne)

Wend

End Sub


Thanks for any help with this NotesViewEntryCollection class!

Subject: Problem with NotesViewEntryCollection class

Make sure your “key” is the first column in the ‘getviewtwo’ and key has some value in it. If so you should definitely get the collection. Give another try by trimming the key value as :key = trim$(DocOne.mykeyfieldname(0))

Subject: RE: Problem with NotesViewEntryCollection class

Sorry, my fault.

Well, it looks like I need the third column actually.

Column1 is: Ascending & Categorized

Column2 is: Ascending

Column3 is: Ascending & Categorized

I’m not sure how to include this?

Set VeCol = ViewTwo.GetAllEntriesByKey(key, True)

Set Ventry = VeCol.GetFirstEntry()

But look into the 3rd column to get docs with the key is. Ventry.ColumnValues(3)…not sure how to include that.

Subject: Problem with NotesViewEntryCollection class

Oops! duplicate posting. Please see above posting.

Subject: Problem with NotesViewEntryCollection class

Your while loop should be checking Ventry and not DocTwo.

Subject: RE: Problem with NotesViewEntryCollection class

Oops…thanks!

So is it possible to get the docs from the ViewEntry based on the key “and” picking from the third column?

Ventry.ColumnValues(3)

I’m just ready to throw in the towel and make 2 views where the key is the first categorized column. Thanks again…

Subject: RE: Problem with NotesViewEntryCollection class

What about this? I’m looking to get the entry with key from column 3.

Dim Column As NotesViewColumn

Set Column = ViewTwo.Columns( 2 )

Am I barking up the wrong tree?

Subject: RE: Problem with NotesViewEntryCollection class

You are going to have to be more specific as I am not sure what it is that you are trying to do??