Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DRM Javascript AncestorsWith Function

JordanWilcoxMar 25 2014 — edited Apr 4 2014

Hello DRM Folks,

Has anyone had success using one of the xxxWith methods via Javascript in DRM (AncestorsWith, ChildrenWith, DescendantsWith, SiblingsWith)?

I am trying to write a script that will return the ancestor at level 3. All of these methods require a function that takes a single node object argument and returns true or false. There is no method I can see in the documentation that is like "IsLevel", so I am assuming we have to create our own function in the script to handle this. I've tried this many ways and have verified that my function does work on its own, but does not work within the AncestorsWith method.

function isLevelThree(ancestorNode)

{

  if ( ancestorNode.Level == 3 ) { return true; }

}

return node.AncestorsWith(isLevelThree(node.NodeByAbbrev(node.PropValue("Core.Abbrev"))), 1, false, false);

This code returns "DRM-16009: Unexpected null".

Any direction would be greatly appreciated!

Thanks,

Jordan

This post has been answered by Mukesh Pardasani on Apr 1 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details