I have this block of code in a Java Method:
colVal = ve.getColumnValues();
System.out.println("Got colVal");
System.out.println("Col values = " + colVal.toString());
try {
Document pDoc = ve.getDocument();
System.out.println("Start MyDate");
DateTime dt = (DateTime) pDoc.getItemValueDateTimeArray("ExpPayDate").get(0);
Date pDate = dt.toJavaDate();
pItem.setMyDate(pDate);
} catch (Exception e) {
// date error
System.out.println("setMyDate Failed "+ e.toString());
}
The log looks like this:
12/09/2015 02:49:59 PM HTTP JVM: Got colVal
12/09/2015 02:49:59 PM HTTP JVM: Col values = [1bp8frg61ze9s, 24/09/2015 12:00:00 PM MDT, , 0.0, ---, , --- No Agent ---, , ]
I use the ViewEntry because I need to maintain the view sort order.
The problem with this is that the ve.getDocument()
means an extra trip to the server and is could become fairly expensive.
So I have tried to work just with the colVal.get(1), it is viewed as a Notes DataTime but colVal.get(1).toJavaDate() does not seem to be available.
Changed the code to try to get the value from the colVal:
System.out.println("Got colVal");
System.out.println("Col values = " + colVal.toString());
try {
System.out.println("Start MyDate");
System.out.println("Get value from colVal " + colVal.get(1).toString());
//pItem.setMyDate(pDate);
} catch (Exception e)
System.out.println("setExpPayDate Failed " + e.toString());
}
When I run this "get value from colVal " causes an error :
12/09/2015 03:05:55 PM HTTP JVM: Start MyDate
12/09/2015 03:05:55 PM HTTP JVM: setMyDate Failed java.lang.ClassCastException: lotus.domino.local.DateTime incompatible with java.lang.String
I can do what I need from the document but can't seem to get there from the viewEntry and the ve.getColumnValues().