Search code examples
lotus-noteslotus-dominolotusscriptlotus-formula

Lotus Notes: Is it possible to create a view that excludes documents in all folders other than Inbox?


I am aware that you can exclude certain folders - but you have to name them. I need a view to show only the documents in the inbox, that doesn't need updating everytime we create a new folder.

Any help would be greatly appreciated!

:)


Solution

  • It is not possible directly. There are no formulas that would help you build a select statement to get documents that are only in the Inbox. However, you could have an agent run on a scheduled basis (maybe every 5-10 minutes) that would update documents and flag them if they are in the inbox. Your view would then just need to select documents that have that flag set.

    Updated As umeli pointed out, the flag needs to be unset when documents are moved out of the Inbox. Here's a modified script:

    For example:

    Dim s as New NotesSession
    Dim db as NotesDatabase
    Dim view as NotesView
    Dim doc as NotesDocument
    Dim allEntriesInbox as NotesViewEntryCollection
    Dim allEntriesFlagged as NotesViewEntryCollection    
    
    Set s = New NotesSession
    Set db = s.CurrentDatabase
    Set view = db.GetView("($Inbox)")
    Set viewFlagged = db.GetView("IsInInboxView")
    
    Set allEntriesInbox = view.AllEntries
    Set allEntriesFlagged = viewFlagged.AllEntries
    
    allEntriesFlagged.StampAll("IsInInbox", "")
    allEntriesInbox.StampAll("IsInInbox, "1")
    

    Your view (named "IsInInboxView" in this example) should have a selection formula of IsInInbox = "1"