How to retrieve all the column names using domino java api?

Hello All,

I want to retrieve all the column names inside a view in a database using the domino java api.

Using the getColumnNames() method, on a particular view, i can retrieve very few fields related to any item(for eg : ToDo’s).

What should i do in order to get all the fields/column names related to a particular view in the databse?

Thanks in advance,

Charles.

Subject: How to retrieve all the column names using java api?

Forgive me if I am misunderstanding the question, or telling you stuff you already know!..

Lifted straight from the Notes help:

Vector columnNames = view.getColumnNames();

for (int i=0; i<columnNames.size(); i++) {

 System.out.println("\t#" + new Integer(i+1) + "\t" +

  (String)columnNames.elementAt(i)); 

}

…will loop accross the columns in a view and get the column name. Is this not working?, are some view columns not being returned?

To get all the fields and columns are two different things, beacause what is shown in the columns could be different fields (or multiple fields or combination of fileds) depending on say, a status field, or the view may contain more than one type of document…so column number 3 might show “document Creator” if it is the parent document, but “last modifier” if it is a child document, and this field might be a different name.

If you want to get all the field names, you will have to loop through all the “documents” in the view (or until you have picked up all the known document types), and for each type of “Form” used to create a document, loop across the fields for that document. If fields have been created on documents using the back end, you might find fields that do not even exist on the “forms”.

Does this help?

Nick