AnsweredAssumed Answered

Using Rule to Delete Empty Space Issues

Question asked by mcook on Oct 24, 2009
I am trying to design a rule to delete the space it is on when it is empty.  I have thus far been unsuccessful.  Ive set the trigger to be outbound and to execute a script:

var children = document.parent.children;
if ( children.length == 0 ) {
     document.parent.remove();
}

However, Ive run into 2 issues:

  • The last document to be deleted shows up in children so the length is still 1.  I changed the condition to children.length == 1, but that produced the next issue.
  • When it tried to delete the space I get the following error: 10:59:01,581 ERROR [org.alfresco.web.ui.common.Utils] Unable to delete Space due to system error: null.  Ive ascertained that it is referring to the document being deleted.
Any thoughts of how to fix this or get around it would be much appreciated.

Matt

Outcomes