var documento = document.name;
var nombre = documento.substr(0,5);
//NUEVA FORMA DE BUSCAR
var Folder = search.luceneSearch("+PATH:\"app:company_home/*\" +TYPE:\"cm:folder\" +@cm\\:name:\"000053Ramírez\"");
var pendientes = space.childByNamePath("pendientes");
if (Folder != null && Folder.hasPermission("CreateChildren"))
{
var copy = document.move(Folder);
if (copy != null)
{
document.name = documento;
document.save();
}
}
else
{
var copy = document.move(pendientes);
if (copy != null)
{
document.name = documento;
document.save();
}
}
Ocurrió un error del sistema durante la operación: Failed to execute script 'workspace://SpacesStore/7465b384-cd60-11de-a65d-43cb83d5086a':
Failed to execute script 'workspace://SpacesStore/7465b384-cd60-11de-a65d-43cb83d5086a': TypeError: Cannot find function hasPermission. (AlfrescoScript#7)
var results = store.luceneSearch("TEXT:tomcat");
for (var i=0; i<results.length; i++)
{
out += results.path + "<br>";
}
return out;
}
var documento = document.name;
var nombre = documento.substr(0,6);
var pendientes = space.childByNamePath("pendientes");
var query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += ' + TYPE:"cm:folder"+@cm\:description:\"+ nombre ';
var carpetacliente = search.luceneSearch(query);
var ruta = space.childByNamePath(carpetacliente);
if (ruta != null && ruta.hasPermission("CreateChildren"))
{
var copy = document.move(ruta);
if (copy != null)
{
document.name = documento;
document.save();
}
}
else
{
var copy = document.move(pendientes);
if (copy != null)
{
document.name = carpetacliente;
document.save();
}
}
Ocurrió un error del sistema durante la operación: Failed to execute script 'workspace://SpacesStore/dc818d72-ce10-11de-a65d-43cb83d5086a': Failed to execute script 'workspace://SpacesStore/dc818d72-ce10-11de-a65d-43cb83d5086a': Wrapped java.lang.IllegalArgumentException: Local name cannot be null or empty. (AlfrescoScript#34)
var query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += ' + TYPE:"cm:folder"+@cm\:description:\"+ nombre ';
avar query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += " +TYPE:\"cm:folder\" +@cm\:description:\"+ nombre +"\"";
Prueba y nos dices.Creo que el cambio que necesitas es .. de :Cierto tini, lo estoy haciendo de cabeza y se me paso una comilla doble :avar query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += ' + TYPE:"cm:folder"+@cm\:description:\"+ nombre ';Prueba y nos dices.var query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += " +TYPE:\"cm:folder\" +@cm\:description:\"+ nombre +"\"";
Saludos
var query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += " +TYPE:\"cm:folder\" +@cm\:description:\""+ nombre +"\"";
Dime que tal con este cambio.Error Por favor corrija los errores siguientes y haga clic en Aceptar.El script:
* Ocurrió un error del sistema durante la operación: Failed to execute script 'workspace://SpacesStore/8f2beb23-d29a-11de-8a47-316241369f51':
Failed to execute script 'workspace://SpacesStore/8f2beb23-d29a-11de-8a47-316241369f51': Wrapped java.lang.IllegalArgumentException: Local name cannot be null or empty. (AlfrescoScript#25)
var documento = document.name;
var nombre = documento.substr(0,6);
var pendientes = space.childByNamePath("pendientes");
var query = "+PATH:\"/app:company_home/cm:User Homes/cm:Clientes/*\"";
query += " +TYPE:\"cm:folder\" +@cm\:description:\""+ nombre +"\"";
var carpetacliente = search.luceneSearch(query);
var ruta = space.childByNamePath(carpetacliente);
if (ruta != null && ruta.hasPermission("CreateChildren"))
{
var copy = document.move(ruta);
if (copy != null)
{
document.name = documento;
document.save();
}
}
else
{
var copy = document.move(pendientes);
if (copy != null)
{
document.name = carpetacliente;
document.save();
}
}
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.