The TreeView_CountChildren() function returns the number of children for the specified node in a tree view field.
TreeView_CountChildren(tree_view_field, node_ID)
• tree_view_field – The tree view field containing the node whose children will be counted.
• node_ID – A long integer specifying the ID of the node whose children will be counted.
A long integer containing the number of child nodes.