AnsweredAssumed Answered

JavaScript error

Question asked by mattew80 on Nov 6, 2007
Latest reply on Nov 13, 2007 by kevinr
Hi.
in the first place I must excuse me for my very bad english…but I'm an italian boy :)
I'm studing from the "Alfresco Enterprise Content Management Implementation" book and I want to create a business rule with the follow custom script :

var stagingFolder       = companyhome.childByNamePath("Intranet/Marketing Communications/Website Documents/Staging");
var productionFolder = companyhome.childByNamePath("Intranet/Marketing Communications/Website Documents/Production");

if(stagingFolder != null)
{
   var i=0;
   var today = new Date();
   stagingChildren = stagingFolder.children;
   stagingTotal = stagingChildren.length;
   for(i=0; i<stagingTotal;i++)
   {
      child = stagingChildren[i];
      if(child.properties["cm:from"] <= today)
      {
         child.move(productionFolder);
      }
   }
}

but don't work…probably becouse the Alfresco version of book is 1.4 and I use the 2.1 version.
Any suggestions?

Best regards and thanks for attention,
Matteo

Outcomes