Unable to find the nearest ancestor to the current node given the node type
Content
Following steps...
In EDMCS I have a View with a hierarchy viewpoint.
Select a leaf node, then select the "Source Mapping" property, and then select "Show Property detail",
Expand application node Types
Under "Default Parameters", the "The default Type" is set to "Derived" with the following expression...
{
return node.ancestors.find(ancestorNode =>
ancestorNode.nodeType.name.equals("cMAS_SRC_FGLPosting_NodeType")).name
}
We need to find the nearest ancestor with a given node type.
Currently the expression returns the top most node in the hierarchy that matches the filter and not the node nearest to the current node from which we are searching. How do we find the closest ancestor that matches the filter?
Tagged:
1