cancel
Showing results for 
Search instead for 
Did you mean: 

Is locked?

buurd
Champ in-the-making
Champ in-the-making
Hi!

When running the javascript below I get the an error saying the a file is locked. If I remove the checkout-line it works perfectly. It doesn't matter where I try to put the working copy. I rather start to think that it is the orginal that is locked somehow. What could be the cause of the problem?

Thanks in advance
Roland


var sourcePath = "myDocuments/Kallelse.dot";

// Attemt to get the node for the sourceDocument
var sourceNode = userhome.childByNamePath(sourcePath);

// Copy the node to the current directory and rename it.
var destinationNode = sourceNode.copy(space);
destinationNode.name = destinationNode.id + ".doc";

// Checkout the document to the currentUsers homespace.
destinationNode.checkout(userhome);
1 REPLY 1

buurd
Champ in-the-making
Champ in-the-making
As it turned out I had a rule in the space I was testing in. It was not my script that throwed the error but the rule that could not fire because the file was checked out.  Smiley Surprisedops:

Hope it helps someone else.

Best regards
Roland