hey,
Writing a custom tag for this specific situation is probably your best bet. The custom tag would accept an SH_ID, build the CFTREEITEM tag for that specific node of the tree, execute a query against your table where SH_PARENT = (the current SH_ID), loop through the results of the query, and for each record, call the same custom tag passing the child's SH_ID to it dynamically. Then you get a nice little recursive function. Also, you probably want to have the custom tag accept SH_PARENT as an attribute as well, since you need to specify the parent attribute in the CFTREEITEM tag in order to "link" the nodes together. If you like, feel free to e-mail me off list and I can give you a more detailed response. -Cliff On Fri, 25 Oct 2002 14:21:48 -0700 (PDT), [EMAIL PROTECTED] wrote: > > > I have never used CFTREE before an have an opportunity to use it now. I played > around a little bit with it to get an idea of how it works. Now I want to > populate my tree dynamically. > > > > SITUATION > > --------- > > > > I have a table in which a sales hierarchy is stored. There are 6 levels to this > hierarchy in which each subsequent level is a child of the previous level with > Level 1 being the top level. > > 1 - Country > > 2 - Sales Org > > 3 - Quota Unit > > 4 - Region > > 5 - District > > 6 - Territory > > > > The data is stored in a table with the following fields > > > > SH_ID int (identity) Unique number incremented > > SH_LEVEL int Level number 1 - 6 > > SH_VALUE varchar(50) Text Description of the Hierarchy Item > > SH_PARENT int The SH_ID of the parent record * The top level > > (Country) has a SH_PARENT = 0 > > > > > > Anybody have an idea how I will beable to dynamically populate a 6 level tree? > > > > Eric > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

