As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
var strTargetNode = "Obsoletos"; var strDocumentName = document.name; // Solo para documentos (discrimina espacios) if (document.isDocument){ // Seteamos el espacio de documentos Obsoletos var targetNode = space.childByNamePath(strTargetNode); if (targetNode == null && space.hasPermission("CreateChildren")) { targetNode = space.createFolder(strTargetNode); } if (targetNode != null && targetNode.hasPermission("CreateChildren")) { var docObsoleto = targetNode.childByNamePath(strDocumentName); if (docObsoleto == null) { docObsoleto = document.copy(targetNode); docObsoleto.addAspect("cm:versionable"); } if (docObsoleto != null && docObsoleto.isVersioned) { var workingCopy = docObsoleto.checkout(); workingCopy.content = document.content; workingCopy.mimetype = document.mimetype; docObsoleto = workingCopy.checkin('Documento Obsoleto'); } } }