FindFolderByName method: PortalRegistry class
Syntax
FindFolderByName(Name)
Description
The FindFolderByName method returns the Folder object corresponding to Name. The name is a unique identifier for each folder.
Parameters
| Parameter | Description |
|---|---|
|
Name |
A unique name within the registry that identifies the folder. This parameter takes a string value. This parameter takes the name of a folder, not the label. |
Returns
What this method returns depends on the condition of the folder:
-
If the folder name is valid and the end-user has access to the folder, a folder object is returned.
-
If the folder is valid but the end-user doesn't have access to it a folder object is returned, however, the only property you can access is the Authorized property.
-
If you specified an invalid name this method returns NULL.
Example
The following example returns a folder named ROOT:
&MyFolder = &MyPortal.FindFolderByName("ROOT");
The following example returns the folder object for an already instantiated content reference:
&Folder = &Portal.FindFolderByName(&CRef.ParentName);
Considerations on Returned Folders
This method returns Folder objects that aren't yet valid as well as ones that are no longer valid. When you create your program, check for these properties (ValidTo and ValidFrom) if you don't want to use them.
This method returns folder objects that you aren't authorized to. When you create your program, always check the Authorized property. This is the only property you can view from an object that you're not authorized to view.
Related Topics