<?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: Unique number in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58164#M20787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This field is getting added&amp;nbsp;by apply aspect. So it would be difficult to modify out of the box 'Save' functionality&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jul 2018 11:46:15 GMT</pubDate>
    <dc:creator>ratik_singhal</dc:creator>
    <dc:date>2018-07-09T11:46:15Z</dc:date>
    <item>
      <title>Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58159#M20782</link>
      <description>&amp;nbsp;I want to create a property (d:int) which would unique across the repository.&amp;nbsp;e.g User cannot enter a number which already exists. It would display error that 'Duplicate Number'I have another alternative that I can go for an autogenerated number but the customer did not agree on this.&amp;nbsp;</description>
      <pubDate>Mon, 09 Jul 2018 10:20:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58159#M20782</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-07-09T10:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58160#M20783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to set the restriction at repository layer, you can use a &lt;STRONG&gt;constraint&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/community/concepts/metadata-model-contraints.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/community/concepts/metadata-model-contraints.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blog.arvixe.com/custom-constrains-in-alfresco-model/" rel="nofollow noopener noreferrer"&gt;https://blog.arvixe.com/custom-constrains-in-alfresco-model/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also add a JavaScript validation for Share UI in Form Field Validation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/community/concepts/dev-extensions-share-form-field-validation-handlers.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/community/concepts/dev-extensions-share-form-field-validation-handlers.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 10:30:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58160#M20783</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-07-09T10:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58161#M20784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its bit difficult.One approach would be like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a behavior/policy in alfresco(OnCreateNode).This policy should search the document with the value user has entered in the form for your specific unique property.If document has been found.Throw exception.So the new document will not get create with duplicate value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to implement policies and behavior , you can find more details on below link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/5.1/references/dev-extension-points-behaviors.html" title="https://docs.alfresco.com/5.1/references/dev-extension-points-behaviors.html" rel="nofollow noopener noreferrer"&gt;Behaviours / Policies | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html" title="https://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html" rel="nofollow noopener noreferrer"&gt;Implementing Custom Behaviors in Alfresco | ECMArchitect | Alfresco Developer Tutorials&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 10:41:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58161#M20784</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2018-07-09T10:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58162#M20785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used this approach in another situation but difficult was that when we are throwing an error from Java. We are not able to show error on Share UI because we are not adding any new share UI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g - I am adding a new Field on 'Create Folder' form like UniqueNumber (d:int) of This Folder.&amp;nbsp; So If I handle this in behavior&amp;nbsp;on update/create policy. In that case, I can not show error on UI.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 10:59:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58162#M20785</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-07-09T10:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58163#M20786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we don't handle the exception in back end , it will throw exception in share UI as well.The only thing is , its bit of an ugly message string.If that is what you are worried about than.You can customize the field and add validate button.On click of validate display error message which you would like to have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 11:21:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58163#M20786</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2018-07-09T11:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58164#M20787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This field is getting added&amp;nbsp;by apply aspect. So it would be difficult to modify out of the box 'Save' functionality&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 11:46:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58164#M20787</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-07-09T11:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58165#M20788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not need to modify save functionality define the custom control for your field.You only need to customize field.Refer below link for more details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/4.0/tasks/forms-custom-formcontrol.html" title="https://docs.alfresco.com/4.0/tasks/forms-custom-formcontrol.html" rel="nofollow noopener noreferrer"&gt;Providing a custom form control | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jul 2018 11:58:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58165#M20788</guid>
      <dc:creator>krutik_jayswal</dc:creator>
      <dc:date>2018-07-09T11:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unique number</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58166#M20789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have solved this issue in a very effective manner. I have overridden the "form.post.json.js" file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I have to validate this before DML perform.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try&lt;BR /&gt;{&lt;BR /&gt;if(itemId == "xm:ratik" ){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;var luceneQuery = "@xm\\:ratik:24";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;var&amp;nbsp;result = search.luceneSearch(luceneQuery);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(&lt;SPAN&gt;result&lt;/SPAN&gt; != ""){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;status.setCode(409, "duplicate..");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;return;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;persistedObject = formService.saveForm(itemKind, itemId, repoFormData);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried with constraint handler but Ajax request is the problem in&amp;nbsp;&lt;SPAN&gt;constraint handler. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I hope that i was able to explain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 08:39:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/unique-number/m-p/58166#M20789</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-08-01T08:39:15Z</dc:date>
    </item>
  </channel>
</rss>

