AnsweredAssumed Answered

Javascript behaviour - some functions not available

Question asked by stevegreenbaum on Jan 28, 2012
Latest reply on Feb 1, 2012 by jpotts
I created a simple behavior that invokes a javascript function that specializes the type of the incoming document, but I receive an error when it is executed.

I tried two different methods:

1.   Using Javascript API – document.specializeType(“mytype”);

                Log message received - Cannot find function specializeType.

2.   Execute OOTB action – “specialise-type”

                Log message received - Can't find method org.alfresco.repo.jscript.ScriptAction.execute(org.alfresco.repo.jscript.ChildAssociation). (alfresco/extension/scripts/onDocumentUpdate.js#15)

There are no other ERROR in the log from startup.  I tried a different Javascript command – example – isSubType and receive the same error message.  I tried it in v3.4 and 4.0b with the same result.

The onCreateNode policy fires for cm:content.  The script does get executed, but the commands mentioned above fail.

Why can’t I access these items in a script when executed by a behavior?