04-09-2015 12:15 PM
var nombre = document.name;
var codigo = nombre.replace("Ax_","");
var codigo_final = codigo.replace(".pdf","");
document.properties["ax:numeroAnexo"] = codigo_final;
var SpaceFinal = companyhome.childByNamePath("Final");
var SpacePendiente = companyhome.childByNamePath("Pendientes");
var doc_contrato = encontrarContrato(codigo_final);
if (!(doc_contrato==null))
{
doc_contrato.properties["co:estado"] = "Firmado";
doc_contrato.properties["co:fechaContrato"]=getToday();
doc_contrato.move(SpaceFinal);
document.move(SpaceFinal);
}
else
{
document.move(SpacePendiente);
}
function encontrarContrato (codigo_contrato)
{
var query ="co:numeroContrato:*"+codigo_contrato+"*";
var store ="workspace://SpacesStore//Company Home/Pendientes";
var results = search.luceneSearch (store,query);
if (!(results == null))
{
return results[0];
}
else return null;
}
function getToday()
{
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){
dd='0'+dd;
}
if(mm<10){
mm='0'+mm;
}
var today = dd+'/'+mm+'/'+yyyy;
return today;
}
04-10-2015 12:14 PM
04-14-2015 07:49 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.