Folder Class Reference
The Folder class represents folders in the Magentrix Document Library. Folders organize documents, bookmarks, marketing links, and other content types in hierarchical structures with configurable sharing permissions and collaboration settings.
Overview
The Folder class provides the foundation for organizing Document Library content. Folders can be nested to create hierarchical structures, shared with specific users or groups, and configured with collaboration and sorting preferences.
Key Characteristics:
- Hierarchical organization through ParentId relationship
- Configurable sharing and permissions
- Support for nested folder structures (unlimited depth)
- Owner-based access control with administrator override
- Collaboration and rating settings
- Roll-up counts of contained documents
Entity Name:Folder
Folder Properties Reference
Core Properties
| Property | Type | Required | Description |
|---|
| Id | string | Auto | System-generated unique identifier (read-only) |
| Name | string | Yes | Folder name displayed in Document Library (max 120 characters) |
| ParentId | string | No | ID of parent folder (null for root-level folders) |
| OwnerId | string | No | User ID of folder owner |
| Description | string | Yes | Description of folder purpose or contents (max 255 characters) |
| Keywords | string | No | Comma-separated keywords for search (max 255 characters) |
| Type | string | No | Folder classification (Standard, Shared, Archive, etc.) |
Collaboration Settings
| Property | Type | Required | Description |
|---|
| DisableCollaboration | bool | No | If true, users cannot post comments or collaborate on files in folder |
| EnableRating | bool | No | If true, users can rate documents in folder |
Sorting Configuration
| Property | Type | Required | Description |
|---|
| SortByFieldName | string | No | Default field for sorting documents (Name, CreatedOn, ModifiedOn) |
| SortDirection | string | No | Sort order (Ascending or Descending) |
Security and Permissions
| Property | Type | Required | Description |
|---|
| SecurityType | string | No | Access model (All Users, Private, Certain Groups) |
| Permission | bool | No | If true, enforces folder-specific permissions instead of inheriting from parent |
Metadata
| Property | Type | Required | Description |
|---|
| ApiName | string | Yes | Unique developer name for integrations and code (max 80 characters) |
| IsCustom | bool | No | True for user-created folders; false for system folders |
| DocumentCount | int | No | Number of documents in folder (read-only, roll-up count) |
System Fields
| Property | Type | Required | Description |
|---|
| CreatedOn | DateTime | Auto | Timestamp when folder was created (read-only) |
| CreatedById | string | Auto | User ID who created folder (read-only) |
| ModifiedOn | DateTime | Auto | Timestamp of last modification (read-only) |
| ModifiedById | string | Auto | User ID who last modified folder (read-only) |
| IsDeleted | bool | No | True if folder is in recycle bin (soft delete flag) |
Folder Methods Reference
| Method | Return Type | Description |
|---|
| ShareWithAllUsers() | void | Share folder with all portal users |
| ShareWithSpecificUsers(List<FolderSharingOption> permissions) | void | Share folder with specific users, groups, or security roles |
Method Details
ShareWithAllUsers
Shares the folder with all portal users.
Signature:
void ShareWithAllUsers()
Parameters:
Returns:
Description: Makes the folder accessible to all authenticated portal users. Guest users (non-authenticated) can access the folder if the Guest Security Role has Read permission on the Folder (system) entity. This sets the SecurityType to indicate all-user access.
Access Control:
- Only folder owner or administrators can call this method
- Requires Edit permission on Folder (system) entity
ShareWithSpecificUsers
Shares the folder with specific users, user groups, or security roles with defined permission levels.
Signature:
void ShareWithSpecificUsers(List<FolderSharingOption> permissions)
Parameters:
permissions (List<FolderSharingOption>, required) - List of sharing permissions specifying users/groups and their access levels
Returns:
Description: Configures granular folder access by specifying which users, user groups, or security roles can access the folder and their permission level. Each FolderSharingOption defines a RecordId (user, group, or role ID) and an AccessLevel (FullControl, CanUpload, or CanView).
Access Control:
- Only folder owner or administrators can call this method
- Requires Edit permission on Folder (system) entity
FolderSharingOption Structure:
RecordId (string) - ID of User, UserGroup, or SecurityRoleAccessLevel (string) - Permission level: "FullControl", "CanUpload", or "CanView"
Property Details
Name
The folder name displayed in the Document Library interface.
Type: string
Required: Yes
Max Length: 120 characters
Usage:
- Displayed in folder navigation
- Used in breadcrumbs and UI
- Should be descriptive and follow naming conventions
ParentId
ID of the parent folder, enabling nested folder hierarchies.
Type: string
Required: No
Default: null (root-level folder)
Usage:
- Set to null for root-level folders
- Set to parent folder's Id for nested folders
- Unlimited nesting depth supported
- Used to build folder tree structures
OwnerId
The user ID of the folder owner.
Type: string
Required: No
Default: Current user's ID
Usage:
- Owner has full control over folder
- Owner can configure sharing settings
- Administrators can override ownership restrictions
SecurityType
Defines the access model for the folder.
Type: string (Picklist)
Required: No
Valid Values:
- Private (default) - Visible only to owner and administrators
- All Users - Visible to all portal users
- Certain Groups - Visible to specific users/groups (configured via ShareWithSpecificUsers)
Usage:
- Set automatically by sharing methods
- Determines base access control
- Works in conjunction with FolderSharingOption settings
DisableCollaboration
Controls whether users can collaborate on files within the folder.
Type: bool
Required: No
Default: false
Usage:
- When true, users cannot post comments or use social collaboration features
- When false, collaboration features are enabled
- Affects all documents in folder
EnableRating
Enables or disables rating functionality for documents in the folder.
Type: bool
Required: No
Default: false
Usage:
- When true, users can rate documents
- When false, rating feature is disabled
- Affects user engagement and feedback capabilities
SortByFieldName
Default field used to sort documents in the folder.
Type: string (Picklist)
Required: No
Valid Values:
- Name - Sort by document name
- CreatedOn - Sort by creation date
- ModifiedOn - Sort by last modification date
Usage:
- Controls default sort order in folder view
- Can be overridden by user preferences in UI
SortDirection
Default sort direction for documents in the folder.
Type: string (Picklist)
Required: No
Valid Values:
- Ascending - A to Z, oldest to newest
- Descending - Z to A, newest to oldest
Usage:
- Works with SortByFieldName property
- Determines display order in folder view
DocumentCount
Roll-up count of documents currently in the folder.
Type: int
Required: No
Read-Only: Yes
Usage:
- Automatically calculated by platform
- Includes all Document records where FolderId matches folder's Id
- Cannot be set manually
- Used for analytics and folder management
Permission
Determines whether folder enforces its own permissions or inherits from parent.
Type: bool
Required: No
Usage:
- When true, folder uses its own permission configuration
- When false, folder inherits permissions from parent folder
- Allows flexible permission models in nested hierarchies
IsCustom
Indicates whether folder was created by users versus system-provided.
Type: bool
Required: No
Usage:
- True for user-created folders
- False for system default folders
- Used for filtering and management operations
IsDeleted
Soft-delete flag indicating folder is in recycle bin.
Type: bool
Required: No
Usage:
- True if folder is deleted (in recycle bin)
- False for active folders
- Allows recovery of deleted folders
- Folders with IsDeleted=true are hidden from normal views
ApiName
Unique developer name for the folder used in integrations and code.
Type: string
Required: Yes
Max Length: 80 characters
Usage:
- Must be unique across all folders
- Used for programmatic folder reference
- Follows naming conventions (typically alphanumeric with underscores)
- Used in API integrations and code references
Keywords
Comma-separated keywords for search and discovery.
Type: string
Required: No
Max Length: 255 characters
Usage:
- Improves folder searchability
- Used by Document Library search functionality
- Should include relevant terms for folder content
- Comma-separated for multiple keywords
Description
Free-form notes describing folder purpose or contents.
Type: string
Required: Yes
Max Length: 255 characters
Usage:
- Provides context about folder purpose
- Visible to users with folder access
- Should clearly describe folder contents or use case