Limitation/Bug with notesViewEntry.ChildCount?

Anybody know why the notesViewEntry.ChildCount datatype is of integer? Why not long?

I’m rewriting a number of report agents and am implementing the use of “NotsViewNavigator” and “NotesViewEntry.ChildCount”. The run times of the original code was in the region of 5-30 minutes. Now the run times are in the region of 10-60 seconds.

Unfortunately, while checking the results of one report, I spotted a negative number. This has triggered a red flag off in the back of my mind …

I can no longer use the NotesViewEntry.ChildCount because of the following reason:

Say you have the following code:

if ( nve.ChildCount < 50 ) then

AddToLowCountReport( )

else

AddtoHighCountReport( )

end if

Now, if a particular NoteViewEntry has 35,000 child documents, the function “AddToLowCountReport” will be called, instead of the “AddToHighCountReport” … because 35,000 is higher than 32,767 and NotesViewEntry.ChildCount would return “-2233” (I think - definitely a negative number). Or 65,550 child documents would be returned as “15” …

Would this be a bug?

I now have to go back to those agents and implement another way of counting the documents in each category quickly …

Subject: Limitation/Bug with notesViewEntry.ChildCount?

I think you’ll have to get another notesviewnavigator from the child entries of the notesviewentry and return the count of that (which is a Long).

Look at CreateViewNavFromChildren and see if that does what you want.

Dan

Subject: RE: Limitation/Bug with notesViewEntry.ChildCount?

Thanks for the tip about using another NotesViewNavigator …

Just tried using the CreateViewNavFromChildren.

Unfortunately, it is not quick - took more than 4 times longer to run … from 15 seconds to 60+ seconds - I stopped the agent after 1 minute.

Instead, I used the NotesView.GetAllEntriesByKey and picked up the count from the collection … works quite well - the agent runtime is still around 15-20 seconds.