AnsweredAssumed Answered

creating rule to delete node with sleep time is not working on folder

Question asked by kranthi on Feb 5, 2018
Latest reply on Feb 6, 2018 by mehe

Hi All,

 

I am creating rule to delete node with sleep time is not working on folder.I just checked in java-script console it is working and same code is not working if apply through rule on folder. And also in that document is not able to delete in that sleep period.

var nodeRefs = companyhome.childByNamePath("Test");
if(nodeRefs!=null)
{
var nodes = nodeRefs.children;
for (var i=0; i<nodes.length; i++) {
sleep(50000);
if(nodes[i].isDocument)
{
nodes[i].remove();
}
console.log("i:"+i);
}
}

function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
}

Outcomes