<?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 How to complete my Java script to rename file in new version if exist in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-complete-my-java-script-to-rename-file-in-new-version-if/m-p/110207#M30863</link>
    <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;I have a rules set like this :&lt;/P&gt;&lt;P&gt;If name file start with "BondeCommande" so execute MyJavaScript-toRename.js&lt;/P&gt;&lt;P&gt;MyJavaScript-toRename.js =&lt;/P&gt;&lt;PRE&gt;var numero =  document.properties["alah:BDC-SEDIT-propriete"];
var tiers =  document.properties["alah:BDC-SEDIT-LibelleTiers"];
var libelle =  document.properties["alah:BDC-SEDIT-ObjetCommande"];
document.name = "BC" + "_" + libelle + "_" + tiers + "_" + numero + ".pdf";
document.save()

&lt;/PRE&gt;&lt;P&gt;It work good.&lt;/P&gt;&lt;P&gt;But if a new file come in the same folder, i have an error "already exist".&lt;/P&gt;&lt;P&gt;I need your help to complete my JS to add condition if exist so replace in a new version 1.1.&lt;/P&gt;&lt;P&gt;Can you help me ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please don't ask to me to use webscript, i'm so far to understand this...&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp; !&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2020 11:33:06 GMT</pubDate>
    <dc:creator>castelsarrasin</dc:creator>
    <dc:date>2020-05-14T11:33:06Z</dc:date>
    <item>
      <title>How to complete my Java script to rename file in new version if exist</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-complete-my-java-script-to-rename-file-in-new-version-if/m-p/110207#M30863</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;I have a rules set like this :&lt;/P&gt;&lt;P&gt;If name file start with "BondeCommande" so execute MyJavaScript-toRename.js&lt;/P&gt;&lt;P&gt;MyJavaScript-toRename.js =&lt;/P&gt;&lt;PRE&gt;var numero =  document.properties["alah:BDC-SEDIT-propriete"];
var tiers =  document.properties["alah:BDC-SEDIT-LibelleTiers"];
var libelle =  document.properties["alah:BDC-SEDIT-ObjetCommande"];
document.name = "BC" + "_" + libelle + "_" + tiers + "_" + numero + ".pdf";
document.save()

&lt;/PRE&gt;&lt;P&gt;It work good.&lt;/P&gt;&lt;P&gt;But if a new file come in the same folder, i have an error "already exist".&lt;/P&gt;&lt;P&gt;I need your help to complete my JS to add condition if exist so replace in a new version 1.1.&lt;/P&gt;&lt;P&gt;Can you help me ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please don't ask to me to use webscript, i'm so far to understand this...&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp; !&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2020 11:33:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-complete-my-java-script-to-rename-file-in-new-version-if/m-p/110207#M30863</guid>
      <dc:creator>castelsarrasin</dc:creator>
      <dc:date>2020-05-14T11:33:06Z</dc:date>
    </item>
  </channel>
</rss>

