NotesViewEntryCollection not returning correct columns

I place a NotesDocumentCollection into a folder that has different columns then the view the collection was selected from. I use the method PutAllInFolder:

Set db = s.CurrentDatabase

Set dc = db.UnprocessedDocuments

Call dc.PutAllInFolder(folderName)

The folder columns are working correctly ---- the correct values are displayed. The number of documents, etc. are correct also.

I create an empty NotesViewEntryCollection and cycle through the folder adding each document to the NotesViewEntryCollection:

'Create an empty View Entry Collection…

Set vcGlobal = newFolder.GetAllEntriesByKey("TryToFindThisKeyWhichWillBeEmpty", True)	



'Add documents to the View Entry Collection...

Set navFolder = newFolder.CreateViewNav

navCount = navFolder.Count

If navCount > 0 Then

	x = 0

	For x = 1 To navCount

		If x = 1 Then

			Set ve = navFolder.GetFirstDocument

		Else

			Set ve = navFolder.GetNextDocument(ve)

		End If

		'Copy docs into View Entry Collection...

		Call vcGlobal.AddEntry(ve)

	Next

End If

When I attempt to get the NotesViewEntry property ColumnValues, it is showing the original column from the view the NotesDocumentCollection was selected from, which causes an error:

For x = 1 To rowCount

	If x = 1 Then

		Set ve = vc.GetFirstEntry

	Else

		Set ve = vc.GetNextEntry(ve)

	End If

	columnValues = ve.ColumnValues

Next

I thought if a NotesDocumentCollection was placed in a folder with different columns, the View Entries would follow those columns and their values.

Did I miss something?

Thanks!

Dan

Subject: NotesViewEntryCollection not returning correct columns

Hi Dan,

I didn’t try to answer your earlier posting on the same subject but since it’s still a problem, I thought I’d toss some ideas your way.

What happens if you move documents into the folder via the Notes UI rather than through code?

What happens if you move documents into the folder using code, then sometime later, perhaps even after exiting Notes, you look into the column values again?

Any change in either scenario?

Subject: RE: NotesViewEntryCollection not returning correct columns

Scenario 1:I moved the documents into the folder in the UI — did the drag and drop. The documents looked correct — the column displayed the correct values.

Scenario 2:

I ran the code, which placed the selected documents in the folder I created. The documents and columns were correct. I closed Lotus Notes and went back into the folder and everything looked correct again.

Thanks!

Dan

Subject: RE: NotesViewEntryCollection not returning correct columns

You might want to Delete the documentcollection object as well – giving the cache a kick in the shins, as it were.

Subject: RE: NotesViewEntryCollection not returning correct columns

I removed the document collection in the code:Set dc = Nothing

or is there a better way of removing?

Anyway, it didn’t change anything – bummer…

Thanks again!

Dan

Subject: RE: NotesViewEntryCollection not returning correct columns

Yes – the Delete command removes the reference pointer from memory:

Delete dc

Not that it’s necessarily going to do anything in this case, but deleting unused object references is a best-practices idea for LS memory management in any case.