<?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 Kickstart: date in form in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33574#M14187</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to display the current date/datetime in a form. How could I achieve this in the kickstart ui?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw: I wonder whether there is some kind of documentation that explains how to use all the kickstart ui widgets. The documentation I know off is limited to pure Activiti (without kickstart) or, as far as it concerns kickstart, is very basic.&amp;nbsp;Are&amp;nbsp;there some sample processes available?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 13:55:02 GMT</pubDate>
    <dc:creator>mrahn</dc:creator>
    <dc:date>2017-03-21T13:55:02Z</dc:date>
    <item>
      <title>Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33574#M14187</link>
      <description>Dear Community.I want to display the current date/datetime in a form. How could I achieve this in the kickstart ui?Best regardsMarcobtw: I wonder whether there is some kind of documentation that explains how to use all the kickstart ui widgets. The documentation I know off is limited to pure Activit</description>
      <pubDate>Tue, 21 Mar 2017 13:55:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33574#M14187</guid>
      <dc:creator>mrahn</dc:creator>
      <dc:date>2017-03-21T13:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33575#M14188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The community Blog provides the best overview of the kickstart widgets but as you say, it is extremely limited.&lt;/P&gt;&lt;P&gt;There are a couple of ways to display date/time.&lt;/P&gt;&lt;P&gt;1. Retrieve in script and save as a process variable (this would be a fixed datetime).&lt;/P&gt;&lt;P&gt;2. Create a custom widget that displays datetime (this could be static or dynamic).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The biggest problem I have found with the custom stencils is that you cant use them on an existing form.&lt;/P&gt;&lt;P&gt;So, to use a custom widget, you need to start with a custom stencilset when you first create the form.&lt;BR /&gt;&lt;BR /&gt;So, tip for young players. Before you start building anythign real. Create a custom stencilset (even if you have no custom widgets) and use this for creating your forms. This way, you can add custom widgets if needed later.&lt;BR /&gt;&lt;BR /&gt;If you use the default stencilset, you are stuck with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 17:28:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33575#M14188</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-21T17:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33576#M14189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Greg!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I wonder how to retrieve the date in a script. How to post this to a variable? Do you have a example for this?&amp;nbsp;I know Activiti only by Kickstart.&lt;/P&gt;&lt;P&gt;2. I'm aware of the default&amp;nbsp;stencilset difficulty .. there is a hint in the official documentation &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 08:40:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33576#M14189</guid>
      <dc:creator>mrahn</dc:creator>
      <dc:date>2017-03-23T08:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33577#M14190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume by Kickstart you mean the Activiti Enterprise "Kickstart App".&lt;BR /&gt;If so, then following the instructions below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Inside the form editor, add a Display Text field where you want the date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13075_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Now go the the Javascript tab and add a new Javascript block on the formRendered event with the following content:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13082_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the "mydate" field name is the "ID" given to the display text field you added in 1.&lt;/P&gt;&lt;P&gt;On render, you will get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://connect.hyland.com/legacyfs/online/alfresco/13083_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;Notice the current date and time rendered in column 2.&lt;BR /&gt;Obviously you can parse to format to your locale and prefered layout.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 11:53:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33577#M14190</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-23T11:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33578#M14191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Greg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your step-by-step instruction. This kind of help is very appreciated!&lt;/P&gt;&lt;P&gt;I followed your instructions step by step but couldn't get the expected result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking your first&amp;nbsp;screenshot it seems that you have, after the orange "Label 1" field,&amp;nbsp;a "Display value" field and a "Display text" field in the 2nd column. Taking your third screenshot I'd expect the "Display value" field rendering the date whilst the "Display text" field is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;btw: how would I save the new Date() to a process variable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.. we run Activiti Enterprise&amp;nbsp;1.5.3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 14:29:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33578#M14191</guid>
      <dc:creator>mrahn</dc:creator>
      <dc:date>2017-03-24T14:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33579#M14192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dont look at the input field or selector. I used an existing test form. The "Display Text" field is the bottom right field.&lt;/P&gt;&lt;P&gt;The Display Text field has an ID of &lt;STRONG&gt;mydate&lt;/STRONG&gt; (this will be bound to a variable called mydate in the process instance).&lt;/P&gt;&lt;P&gt;The javascript code associated with the FormRendered event is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var myDate = scope.findFormFieldWithId(scope.allFormFields, '&lt;STRONG&gt;mydate'&lt;/STRONG&gt;);&lt;BR /&gt;var now = new Date();&lt;BR /&gt;myDate.value = now;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will automatically create a process variable mydate on submission.&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 14:43:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33579#M14192</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-24T14:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33580#M14193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's sad, but it seams I had a typo. I copied your code and it works fine.&lt;/P&gt;&lt;P&gt;It works exactly as you descripted it.&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 15:18:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33580#M14193</guid>
      <dc:creator>mrahn</dc:creator>
      <dc:date>2017-03-24T15:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33581#M14194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to feedback the community with what we found:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We decided not to&amp;nbsp;follow&amp;nbsp;Gregs client-site&amp;nbsp;approach but use a task listener since it's more flexible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what we've done:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/alfresco/13205_Task listener - language.png" style="width: 620px; height: 463px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="/legacyfs/online/alfresco/13206_Task listener - script.png" style="width: 620px; height: 462px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String:&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #808080;"&gt;var execution = task.execution;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #808080;"&gt;// get current date&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;//var today = task.getCreateTime();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;var today = new Date();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;var mm = today.getMonth() + 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;var yyyy = today.getFullYear();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;if (mm &amp;lt; 10) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;&amp;nbsp;mm = '0' + mm.toString();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;mm = mm.toString();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;yyyy = yyyy.toString();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #808080;"&gt;// get process id&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;var processid = execution.getId();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;processid = processid.toString();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #808080;"&gt;// write to process variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #808080;"&gt;execution.setVariable('casenumber',yyyy+'-'+mm+'#'+processid);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Thus I am able to provide a "case number" (format: yyyy-mm#processid).&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2017 13:04:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33581#M14194</guid>
      <dc:creator>mrahn</dc:creator>
      <dc:date>2017-04-04T13:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Kickstart: date in form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33582#M14195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice work. The only thing I would say is that by doing this on the server, your data will not be localized and be based on the server timezone.&lt;BR /&gt;Typically not an issue but if you are using a hosting service such as AWS/Heroku/Bluemix/Pivotal etc then the timezone may not be what you expect (depends on what region the server is running in).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;G&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Apr 2017 17:09:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/kickstart-date-in-form/m-p/33582#M14195</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-04-05T17:09:58Z</dc:date>
    </item>
  </channel>
</rss>

