Hi,I have a Date field on a xpage, and a button with the next :
var solDoc = database.createDocument();
solDoc.replaceItemValue(“form”,“solMotor”);
solDoc.replaceItemValue(“accion”,“TareaNueva”);
print("DateLimit: " + getComponent(“DateLimit”).getValue());
solDoc.replaceItemValue(“DateLimit”,getComponent(“DateLimit”).getValue()); //Here the error
//On the Server Console
13/04/2009 15:25:37 HTTP JVM: DateLimit: Sat Apr 25 12:00:00 CLT 2009
13/04/2009 15:25:37 HTTP JVM: NotesException: Unknown or unsupported object type in Vector
13/04/2009 15:25:37 HTTP JVM: SEVERE: CLFAD####E: Exception thrown
I can’t get the date value to place it into a document date field…
Any idea?
Thanks
Diego
Subject: More detail needed…
I’ve the following that appears to work ok.
var utx = @Unique();
var newDoc = database.createDocument();
var dt:NotesDateTime = session.createDateTime(@Now());
newDoc.appendItemValue(“Form”, “test”);
newDoc.appendItemValue(“title”, utx);
newDoc.appendItemValue(“testDate”, dt);
newDoc.save();
But this may not suit you
It looks to me that you’re trying to replace ‘DateLimit’ with ‘DateLimit’ that doesn’t exist in the action?
Subject: a bit diferent
i think the problem is when getting the value from the input text control named “DateLimit”.
When i try:
var date:NotesDateTime=session.createDateTime(getComponent(“DateLimit”).getValue());
i get an error…
printing getComponent(“DateLimit”).getValue() i get:
//On the Server Console
13/04/2009 15:25:37 HTTP JVM: DateLimit: Sat Apr 25 12:00:00 CLT 2009
Subject: I had the same error when …
trying to set a field with a @True or true value. Setting the value to 1 instead worked.
Error message was
“Could not save the document nnn NotesException: Unknown or unsupported object type in Vector”
Code causing the error was :-
compositeData.docDataSource.setValue( “fieldname”, true );