AnsweredAssumed Answered

JavaScript to move a doc to a given path

Question asked by jlabuelo on May 18, 2015
Hi there

I am trying to create an inbound rule in a Share 5.0 space so every document is moved to a given path depending on a property value of the type of the document.

The script created to do so seems to be quite easy, but we do not get it to work at all.


<script>
   
   logger.log ("———–COMIENZO————-");
   var departamento = document.properties["hula:departamento"];
   logger.log ("Departamento: "+departamento);
   var departamentoJefe = companyhome.childByNamePath("HULA/Departamentos Jefes/"+departamento);
   logger.log ("Node Jefe: "+departamentoJefe);

   if ((doc != null))
    {
      logger.log ("El documento no existe");
   }
   else
   {
      document.move(departamentoJefe);
      logger.log ("Movido");
   }

</script>



We also are not able to lauch the JAvaScript debugger in Alfresco Share.

Any suggestions about how can we move the document to a known given space??

Thanks a lot

Outcomes