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.
// doc.properties["my:prop1"] = "new constant value"; // doc.properties["my:prop2"] = "new other constant value"'; doc.properties["rma:originator"] = "John Q. Author"; doc.properties["rma:originationOrganization"] = "SomeCO Limited Inc."; doc.properties["rma:publicationDate"] = "Fri Feb 04 01:00:00 EST 2011"; /* more stuff */ doc.save(); /* to save the properties just set *
"22:28:40,403 User:gnyce ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 01040963 Failed to execute script 'workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab': 01040962 ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab#3)org.alfresco.scripts.ScriptException: 01040963 Failed to execute script 'workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab': 01040962 ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab#3) at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:244) at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:195) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<SNIP>Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "doc" is not defined. (workspace://SpacesStore/6376f7ac-4516-4809-8db3-94b08bb32cab#3)"
Caused by: org.alfresco.service.cmr.repository.datatype.TypeConversionException: The property value is not compatible with the type defined for the property: property: Name: {http://www.alfresco.org/model/recordsmanagement/1.0}publicationDateTitle: Publication DateDescription: nullDefault Value: nullDataType Name: {http://www.alfresco.org/model/dictionary/1.0}dateContainerClass Name: {http://www.alfresco.org/model/recordsmanagement/1.0}recordisMultiValued: falseisMandatory: trueisMandatoryEnforced: falseisProtected: falseisIndexed: trueisStoredInIndex: falseisIndexedAtomically: trueindexTokenisationMode: TRUE value: 2011020400:00:00 value type: class java.lang.String
//set variable to be the created value, then set values var PubDate = document.properties["cm:created"]; document.properties["rma:originator"] = "John Q. Originator"; document.properties["rma:originatingOrganization"] = "SOMECO Company Ltd Inc"; document.properties["rma:publicationDate"] = PubDate; document.save();
document.properties["rmc:MyCustomFieldNameHere"] = "Fill in field with this metadata";