Recursive Child Form
Two examples of recursive child forms in netFORUM are the Organization Tree child form on the Individual and Organization profile page. Another example is the sub-committees child form on the Committee profile page, pictured above.
Note that recursive child forms can be slow if you have deeply nested data. For this reason, it is advised to put these child forms on a separate tab to avoid slowing down the form load.
How to Make a Recursive Child Form
To make a recursive child form, you actually need two child forms. The first child form will show the direct children of the parent record. Next, add a Grandchild Form to this first child form; be sure that you have selected the first child form as the parent child form for your second child form, and be sure to check the is recursive checkbox. In most cases, the child form select sql of the grand-child child form will be identical to that of the parent child form.
The SQL of the child forms will have a WHERE clause linking a primary key up to a parent primary key. Here is the Child Form Select SQL for the sub-committee child form (and grandchild form). Look especially at the WHERE clause on line 6:
SELECT cmt_key, [Code]=cmt_code, [Name]=cmt_name, [Type]=cmt_ctp_code FROM mb_committee (nolock) WHERE cmt_parent_key = {cmt_key} AND cmt_delete_flag=0 ORDER BY 2
The recursion comes in because as the grandchild form traverses infinitely downward, each new node "queries up" to its parent node using the cmt_parent_key FK column.