0

Simply put I want something like db.UnprocessedNotesViewEntries just like db.UnprocessedDocuments.

The problem is that the user is presented with a Notes View with a couple of categories 1- Month: like "Jan / 2019" etc. and then 2-Bill Type like HVAC or Electricity or Maintenance etc.

The view is not supposed to have UnProcessedDocuments. The user is supposed to select one or more categories and I want to get hold of the selected categories and then go ahead with those to work on.

The code like following allows me to get the categories but there's no way to get only the selected ones:

    Dim workspace As New NotesUIWorkspace       
    Dim session As New notessession
    Dim db As notesdatabase
    Dim view As NotesUIView 
    Dim nav As NotesViewNavigator   
    Dim entry As NotesViewEntry

    Set db = session.CurrentDatabase    
    Set view = workspace.CurrentView
    Set nav = view.View.CreateViewNav()
    Set entry = nav.GetFirst


    ''Navigate through the selected entries (categories and detail rows) one by one.
    Do Until entry Is Nothing

        If entry.IsCategory Then
            ''just a debugging code which works as expected.
            Print entry.IndentLevel         
            Print entry.ColumnValues(0)
            Print entry.ColumnValues(1)
            Print entry.ColumnValues(2)
            Print entry.ColumnValues(3)         
        End If
        Set entry = nav.GetNext(entry)
    Loop

Please help!

1 Answers1

0

I don't think it is possible. View entries are generated from the backend view and have no link to the user selection. In uiView, you can only get to the caretNoteId, containing the id of the highlighted document (not category). You also have caretCategory, but this only returns the lowest category level of the (again) highlighted document.

To do a similar thing, we use the following (lame) workaround: Create a view with 'ODBC Access' set to 'Generate unique keys in index'.

In this view, create the category columns and one single column containing a fixed text (something like 'Select this category').

Create a second view with the same categorization but with 'ODBC Access' unchecked.

Let the user select the lines 'Select this category' in the first view. Then you use 'unprocessedDocuments' in your script to get the selected rows. Now you can do a search (getdocumentbykey) in the second view to get all documents with the same categories as the selected documents.

Unfortunatelly, this only works when you work with single value fields to generate your categories (otherwise you don't know which value is selected)

Tom Van Aken
  • 435
  • 2
  • 16