Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

I always thought this property would tell the note collection to select all views (excluding desktop private and those to which the user has no access). Not so; it selects all views that are not hidden from the Notes client.

I have a fix for this which may or may not get into 8.5.2, but meanwhile I thought I should let people know, since it came as a surprise to me and I suspect many of you may have code that uses this property and don't realize that you're not locating all the view design elements in apps you're scanning.

The workaround is as follows:

ncoll.Selectallindexelements True
ncoll.Selectionformula =
|!@Matches($Flags; "*{FG^}*")|

The same bug exists in Java (by and large you can assume this as the APIs share a lot of code, except for the XML parsers).

Navigators are also affected; to find all navigators you should write:

ncoll.Selectallindexelements True
ncoll.Selectionformula =
|@Matches($Flags; "*G*")|

The other "select" properties seem to work OK.


Andre Guirard | 29 March 2010 12:59:38 PM ET | Home, Plymouth, MN, USA | Comments (3)


1) Yeah, it’s nasty...
Erik Brooks | 3/29/2010 2:06:30 PM

Thanks for the workaround - that's helpful.

2) Thanks for the workaround, it works great.
Ferry Kranenburg | 3/29/2010 5:04:36 PM

I've just updated my project Source Sniffer on OpenNTF. You need to use the workaround in combination with the normal SelectViews property, or else you'll get only the view that are hidden from the client.

3) I hope my code will still run
Jens Winkelmann | 4/9/2010 12:27:38 PM

This is my code which brings me the design document of the shared template of a private view/folder.

Private Function GetDesignDocOfPOFVFTemplateByName( p_strViewFolderName As String ) As NotesDocument

'// search for shared private on first view / folder

Dim nnc As NotesNoteCollection

Set nnc = m_ndb.CreateNoteCollection( False )

nnc.SelectViews = True

nnc.SelectFolders = True

nnc.SelectionFormula = |(@Contains(@UpperCase(@Implode($Title;""));@UpperCase("| & p_strViewFolderName & |"))) & @Contains($Flags;"p") & !@Contains($Flags;"P")|

Call nnc.BuildCollection

If nnc.Count > 0 Then

Set GetDesignDocOfPOFVFTemplateByName = GetDocumentByID( nnc.GetFirstNoteId )

End If

End Function

I use this code in the Postopen of a private view/folder to check if the design is up-to-date.

I hope this will still run if you 'fix' it.

4) NotesNoteCollection.SelectViews, nasty surprise!
Andre Guirard | 4/20/2010 8:34:35 PM

@Jens, yes it should. We would be adding candidates to the views we might locate, so it's possible a search would return more views than before, but this looks like it's pretty targeted to one specific view. If you want to make sure, you can write your formula to specifically exclude views with an "n" in the $Flags.

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact