05-21-2009 11:51 AM
// Retrieve the last DocID value from the counter at the Space level
if (parseInt(space.properties["custom:numP"]) == null)
LastDocID=0;
else
LastDocID = parseInt(space.properties["custom:numP"]);
// Generate new DocID value
NewDocID = LastDocID + 1;
// Store the new value in the space
space.properties["custom:numP"] = NewDocID;
space.save();
// Store the DocID in the document's metadata
document.properties["custom:numeroP"] = NewDocID;
document.save();
alert("Doc saved");
The rules have been successfully reapplied.
A system error happened during the operation: Transaction didn't commit: Failed to execute script 'workspace://SpacesStore/f4777eb8-fd9c-4591-b9b1-6b2c88109bfe': ReferenceError: "alert" is not defined. (AlfrescoScript#16)
05-21-2009 05:11 PM
05-21-2009 05:54 PM
Your JavaScript is running via Rhino on the server - it's not client-side JavaScript! Therefore you don't have web browser ("DOM") extensions like: window, document, location and alert.
Mike
05-21-2009 06:19 PM
if (logger.isLoggingEnabled())
{
logger.log("Doc saved");
}
and then update the log4j entry:log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug
05-22-2009 04:43 AM
If you mean how can you debug your webscripts, then you can use the following:and then update the log4j entry:if (logger.isLoggingEnabled())
{
logger.log("Doc saved");
}log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug
Thanks,
Mike
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.