How to complete my Java script to rename file in new version if exist
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2020 07:33 AM
Hi !
I have a rules set like this :
If name file start with "BondeCommande" so execute MyJavaScript-toRename.js
MyJavaScript-toRename.js =
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()
It work good.
But if a new file come in the same folder, i have an error "already exist".
I need your help to complete my JS to add condition if exist so replace in a new version 1.1.
Can you help me ?
Please don't ask to me to use webscript, i'm so far to understand this...
Thank you !
Labels:
- Labels:
-
Alfresco Content Services
0 REPLIES 0
