Hi,
Not able to set property of type Datetime in Nuxeo using Automation Scripting (JavaScript). Below is the code snippet:
function run(input, params) {
var d2 = new Date();
d2.setFullYear(d2.getFullYear()+7);
Document.SetProperty(input,{
/*required:true - type: string*/
'xpath':"doc:start_date",
/*required:false - type: boolean*/
'save':true,
/*required:false - type: serializable*/
'value':d2
});
}
Below error is occured in Nuxeo, Please suggest how to do property convert:
Caused by: org.nuxeo.ecm.core.api.model.PropertyConversionException: Property Conversion failed from class org.nuxeo.ecm.automation.core.util.DataModelProperties to class java.util.Calendar
at org.nuxeo.ecm.core.api.model.impl.primitives.DateProperty.normalize(DateProperty.java:66)
at org.nuxeo.ecm.core.api.model.impl.AbstractProperty.setValue(AbstractProperty.java:311)
at org.nuxeo.ecm.automation.core.operations.document.SetDocumentProperty.run(SetDocumentProperty.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)