var props=document.name.split("-");
//props[0] ITEM
//props[1] EMPRESA
//props[2] CLIENTE
//props[3] FECHA
document.properties["prefix:item"]=props[0];
….
document.save();
Espero que te sirva.var props2 = props[4].split(".");
document.properties["prefix:numero"]=props2[0];
document.save();
document.properties["prefix:numero"]=props[4].split(".")[0]
document.save()
<?xml version="1.0" encoding="UTF-8"?>
<model name="viu:visiounifymodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Modelo para Documentación</description>
<author>sexus6</author>
<version>1.0</version>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<namespaces>
<!– Define a Namespace for my new definitions –>
<namespace uri="my.new.model" prefix="viu"/>
</namespaces>
<!– Type and Aspect definitions go here –>
<aspects>
<aspect name="viu:documentos">
<title>Documentos</title>
<properties>
<property name="viu:item">
<type>d:text</type>
</property>
<property name="viu:empresa">
<type>d:text</type>
</property>
<property name="viu:cliente">
<type>d:text</type>
</property>
<property name="viu:fecha">
<type>d:text</type>
</property>
<property name="viu:numero">
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
</model>
var props=document.name.split("-");
document.properties["viu:item"]=props[0];
document.properties["viu:empresa"]=props[1];
document.properties["viu:cliente"]=props[2];
document.properties["viu:fecha"]=props[3];
document.properties["viu:numero"]=props[4];
//document.properties["viu:numero"]=document.properties["viu:numero"].split(".")[0]
document.save();
var props=document.name.split("-");
document.properties["viu:item"]=props[0];
document.properties["viu:empresa"]=props[1];
document.properties["viu:cliente"]=props[2];
document.properties["viu:fecha"]=props[3];
document.properties["viu:numero"]=props[4].split(".")[0]
document.save();
Ya nos cuentas
var props=document.name.split("-");
document.properties["viu:item"]=props[0];
document.properties["viu:empresa"]=props[1];
document.properties["viu:cliente"]=props[2];
document.properties["viu:fecha"]=props[3];
document.properties["viu:numero"]=props[4].substring(0,props[4].indexOf("."))
document.save()
No se puede pegar elemento debido a un error del sistema: Node has been pasted into its own tree.
Caused by: org.alfresco.error.AlfrescoRuntimeException: 05160010 TypeError: Cannot call method "substring" of undefined
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.