<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Set date to property through webscript fails ISOFormat in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232480#M185610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is how the date value is formated using date.format.js script function&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;//unout is 3/4/2010&lt;BR /&gt;function fnToISO(dt) { &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var nDate = new Date(dt);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return nDate.format("isoDateTime");&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; file:D:/Alfresco/tomcat/shared/classes/alfresco/extension/templates/webscripts)': The property valu&lt;BR /&gt;e is not compatible with the type defined for the property:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; property: Name: {&lt;A href="http://www.stepsoln.com/model/content/1.0}effectivedate" rel="nofollow noopener noreferrer"&gt;http://www.stepsoln.com/model/content/1.0}effectivedate&lt;/A&gt;&lt;BR /&gt;Title: null&lt;BR /&gt;Description: null&lt;BR /&gt;Default Value: null&lt;BR /&gt;DataType Name: {&lt;A href="http://www.alfresco.org/model/dictionary/1.0}date" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}date&lt;/A&gt;&lt;BR /&gt;ContainerClass Name: {&lt;A href="http://www.mymodel.com/model/content/1.0}doc" rel="nofollow noopener noreferrer"&gt;http://www.mymodel.com/model/content/1.0}doc&lt;/A&gt;&lt;BR /&gt;isMultiValued: false&lt;BR /&gt;isMandatory: false&lt;BR /&gt;isMandatoryEnforced: false&lt;BR /&gt;isProtected: false&lt;BR /&gt;isIndexed: true&lt;BR /&gt;isStoredInIndex: false&lt;BR /&gt;isIndexedAtomically: true&lt;BR /&gt;indexTokenisationMode: TRUE&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value: 2010-03-04T00:00:00&lt;BR /&gt;&amp;nbsp;&amp;nbsp; value type: class java.lang.String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:6&lt;BR /&gt;13)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Mar 2010 18:19:18 GMT</pubDate>
    <dc:creator>shikarishambu</dc:creator>
    <dc:date>2010-03-25T18:19:18Z</dc:date>
    <item>
      <title>Set date to property through webscript fails ISOFormat</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232480#M185610</link>
      <description>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 dat</description>
      <pubDate>Thu, 25 Mar 2010 18:19:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232480#M185610</guid>
      <dc:creator>shikarishambu</dc:creator>
      <dc:date>2010-03-25T18:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set date to property through webscript fails ISOFormat</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232481#M185611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try to use the Date constructor with all the arguments:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Date yourCustomDate = new Date("2010","02","25");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Now it should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 19:22:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232481#M185611</guid>
      <dc:creator>openpj</dc:creator>
      <dc:date>2010-03-25T19:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Set date to property through webscript fails ISOFormat</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232482#M185612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The issue was due to the fact that Alfresco automatically converts the date passed to ISOFormat. I don't need to do that in my script while trying to upload/ update. I need to do that for search&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Apr 2010 22:07:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/set-date-to-property-through-webscript-fails-isoformat/m-p/232482#M185612</guid>
      <dc:creator>shikarishambu</dc:creator>
      <dc:date>2010-04-27T22:07:46Z</dc:date>
    </item>
  </channel>
</rss>

