Scope of the Tree Objects

All tree objects, that is, trees, tree structures, nodes, leaves, and so on, can only be instantiated from PeopleCode.

This object can be used anywhere you have PeopleCode, that is, in an application class, Application Engine PeopleCode, record field PeopleCode, and so on.

You can instantiate a tree or tree structure object only from a session object. You have to instantiate the session object, and connect to the database, before you can instantiate a tree or tree structure.

Local ApiObject &TREELIST; 
Local ApiObject &MYSESSION; 
&MYSESSION = %Session; 
   /* connection is good */ 
   /* do error processing */ 

Note: Tree Classes are accessible only through PeopleCode.