Retrieving child folders

After retrieving the InfoStore object with the RetrieveIStore function, the first thing that you will want to do is to retrieve a list of all the top level folders in the APS. The manner in which you retrieve a folder object is similar to the manner in which you retrieve many other objects. All objects in the system are either a basic InfoObject or inherit from InfoObject. InfoObject contains basic properties that each object in the Crystal Enterprise system will need and every object can be uniquely identified by its ID. In this section you'll write a generic routine to print a list of folders (InfoObjects that represent directories) at any level so that the user can navigate through both child folders and their parents.

Add the following function header to the Folders.csp file:

function PrintChildFolders(IStore, ParentID)

This function takes two parameters that may be described as follows:
Parameter Description

ParentID

The ID number of the folder that owns the sub-folders that needs to be retrieved.

IStore

The object that enables the APS to be queried for folders.

Go to next step:

Using the Crystal Enterprise query language



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com