Newer Version Available
Folder
Five folder types currently exist in Salesforce:
- Document folder
- Email folder (available for Salesforce Classic email templates only)
- Email Template folder
- Report folder
- Dashboard folder
Folder type names end with the “Folder” suffix. For example, the type name of a document folder is “DocumentFolder”.
File Suffix and Directory Location
Folders are stored in the corresponding component directory of the package. These directories are named documents, email, emailTemplates, reports, and dashboards. Folders don’t have a text file representation—they’re containers for files. For each folder, an accompanying metadata file named FolderName.folderType-meta.xml is created at the same directory level. The FolderName.folderType-meta.xml metadata file contains the metadata information for that folder, such as the accessType. For example, for a documents folder named sampleFolder, there’s a sampleFolder.documentFolder-meta.xml within the documents folder of the package.
Version
Folders are available in API version 11.0 and later.
Fields
This metadata type contains the following fields:
| Field Name | Field Type | Description |
|---|---|---|
| accessType | FolderAccessTypes (enumeration of type string) | Required. The type of access for this folder. Valid values are:
|
| fullName | string | The name used as a unique identifier for API access. The fullName can contain only underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. This field is inherited from the Metadata component. |
| name | string | Required. The name of the document folder. |
| publicFolderAccess | PublicFolderAccess (enumeration of type string) | If Public is the value for
accessType, this field indicates the type of access all users
have to the contents of the folder. Valid values include:
|
| SharedTo | See Sharing Considerations in Salesforce Help. |
Declarative Metadata Sample Definition
The following is the package manifest definition of a document folder that contains a document:
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <fullName>basic</fullName>
4 <types>
5 <members>sampleFolder</members>
6 <members>sampleFolder/TestDocument.txt</members>
7 <name>Document</name>
8 </types>
9 <version>63.0</version>
10</Package>1<?xml version="1.0" encoding="UTF-8"?>
2<DocumentFolder xmlns="http://soap.sforce.com/2006/04/metadata">
3 <accessType>Public</accessType>
4 <name>sampleFolder</name>
5 <publicFolderAccess>ReadWrite</publicFolderAccess>
6</DocumentFolder>Wildcard Support in the Manifest File
This metadata type doesn’t support the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.