AnsweredAssumed Answered

Set date to property through webscript fails ISOFormat

Question asked by shikarishambu on Mar 25, 2010
Latest reply on Apr 27, 2010 by shikarishambu
I am trying to upload a document into the repository using a custom webscript derived from sample/upload. I have a date property that I need to set. I have tried to set it directly, provide ISOFormat but I still get the error. What is the correct format to be used to set the date?

Here is how the date value is formated using date.format.js script function

//unout is 3/4/2010
function fnToISO(dt) {
   var nDate = new Date(dt);
   return nDate.format("isoDateTime");
}


Here is the error


file:D:/Alfresco/tomcat/shared/classes/alfresco/extension/templates/webscripts)': The property valu
e is not compatible with the type defined for the property:
   property: Name: {http://www.stepsoln.com/model/content/1.0}effectivedate
Title: null
Description: null
Default Value: null
DataType Name: {http://www.alfresco.org/model/dictionary/1.0}date
ContainerClass Name: {http://www.mymodel.com/model/content/1.0}doc
isMultiValued: false
isMandatory: false
isMandatoryEnforced: false
isProtected: false
isIndexed: true
isStoredInIndex: false
isIndexedAtomically: true
indexTokenisationMode: TRUE

   value: 2010-03-04T00:00:00
   value type: class java.lang.String
        at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:6
13)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)

Outcomes