<?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 Re: Reinitialize a form in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6657#M3235</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeah, you got to tweak the code to meet your requirement. May be instead of delete,&amp;nbsp;you may want to do something like relatedContent.setField(null);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Feb 2018 15:15:41 GMT</pubDate>
    <dc:creator>cjose</dc:creator>
    <dc:date>2018-02-27T15:15:41Z</dc:date>
    <item>
      <title>Reinitialize a form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6654#M3232</link>
      <description>Hi!,I have a problem, I have a process with a loop with form, but in the next iterations the form not is initialized.Can I do initialize field 'uploadfile' in begin each iteration?Regards,Fernando</description>
      <pubDate>Tue, 20 Feb 2018 12:05:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6654#M3232</guid>
      <dc:creator>fegor</dc:creator>
      <dc:date>2018-02-20T12:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reinitialize a form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6655#M3233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The best way to do that is to&amp;nbsp;put a script/service task in the loop back to delete the existing file. You can use the relatedContentService api (com.activiti.service.runtime.RelatedContentService) to do this..I have a sample groovy script below..the 'uploadfield' will need to be replaced with your upload field id&lt;/P&gt;&lt;PRE class="language-javascript"&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;def page &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;int pageNumber &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN class="keyword token"&gt;while&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;page &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;page&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hasNext&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;BR /&gt; page &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; relatedContentService&lt;BR /&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getFieldContentForProcessInstance&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;BR /&gt; execution&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getProcessInstanceId&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'uploadfield'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;50&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;BR /&gt; pageNumber&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; relatedContentService&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;deleteRelatedContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;page&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getContent&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt; pageNumber&lt;SPAN class="operator token"&gt;++&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ciju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Feb 2018 17:30:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6655#M3233</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-02-23T17:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reinitialize a form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6656#M3234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;B&gt;Ciju Joseph&lt;/B&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I do not want delete the previous files, I need clean fields for a new upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Feb 2018 14:32:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6656#M3234</guid>
      <dc:creator>fegor</dc:creator>
      <dc:date>2018-02-26T14:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Reinitialize a form</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6657#M3235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yeah, you got to tweak the code to meet your requirement. May be instead of delete,&amp;nbsp;you may want to do something like relatedContent.setField(null);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2018 15:15:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/reinitialize-a-form/m-p/6657#M3235</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2018-02-27T15:15:41Z</dc:date>
    </item>
  </channel>
</rss>

