cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot read before/after with onUpdateProperties behaviour.

lyamamot
Champ in-the-making
Champ in-the-making
I've written a JavaScript-based behaviour to hook into onUpdateProperties for one of my custom types. I would like to take some action when a single property, xx:visibility, changes. I followed the steps outlined in Jeff Potts' excellent guide (http://ecmarchitect.com/archives/2007/09/26/770) and it mostly works, but it seems like Alfresco is not setting the before/after variables as they are "null" in my script. That is, I have this script code:

   if (behaviour.args.length == 3) {
      var node = behaviour.args[0];
      // "node" is set and I can access its properties, even node.properties['xx:visibility'].
      var before = behaviour.args[1];
      var after = behaviour.args[2];
      // "before" and "after" are "null" and not useful. They should represent the state of the properties before and after the change.
   }
Am I missing something? Are these values not available to JavaScript scripts?
1 REPLY 1

acarpine
Champ in-the-making
Champ in-the-making