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”.