cancel
Showing results for 
Search instead for 
Did you mean: 

How to set datetime property value from javascript

yash_patel_c2
Star Contributor
Star Contributor

Hi everyone,

I am having two properties having d:datetime type. I want to set values to those properties from workflow. One property will be coming from datepicker (d:datetime property in the workflow model) from the workflow form and other I am taking current date in workflow task. I am attaching these values to the properties by converting it to the ISO8601 format, but I could see only null as attached values.

var currentDate = new Date();
var currentISODate = utils.toISO8601(currentDate);

documents[0].properties["sc:customProperty"] = currentDate;

How can I overcome this issue?

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator

Did you make sure to call save() on the nodes after setting the property? Just assigning the value of properties is not enough in Alfresco server-side JavaScript.