0
votes

I am trying to retrieve data from lotus notes View using the Notes java api, My problem is that I don't find a way to retrieve a specific value from a ViewEntry by a specific column name, I can get a Vector contain all the values, but I don't know which column belong each value. NB, when I'm trying to get the document from the ViewEntry and then use the method "getItemValue(Object)", it does not give me all the values, So I want to use directly the ViewEntry.

this work fine:

ViewEntryCollection viewEntryCollection = view.getAllEntries();
ViewEntry viewEntry = viewEntryCollection.getFirstEntry();

viewEntry.getColumnValues().forEach(item->{
    System.out.println(item);
} );

but this give me null Pointer Exception :

viewEntry.getDocument().getColumnValues().forEach(item->{
                System.out.println(item);
            } );

I'm looking for something like that :

viewEntry.getColumnValue(Object columName);
2

2 Answers

0
votes

You can use the View.getColumnNames() method to get a vector containing the names of the columns. That will let you figure out the column number that you need to use as the index into the vector returned by ViewEntry.getColumnValues()

0
votes

You can use the getColumnValues method of the NotesViewEntry class, but it returns an array of the values in the column. If you know that the data you are looking for is in the 3rd column, you get the 3rd element in the array. If you want to retrieve the value based on the column namn, you first need to read the column names and what column they are located in. Then you can use that to get the proper column in the NotesViewEntry.