How to set datetime property value from javascript

cancel
Showing results for 
Search instead for 
Did you mean: 
yash_patel_c2
Established Member

How to set datetime property value from javascript

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
afaust
Master

Re: How to set datetime property value from javascript

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.