Newer Version Available

This content describes an older version of this product. View Latest

Folder

Represents a folder. This type extends the Metadata metadata type and inherits its fullName field. Four folder types currently exist in Salesforce:

  • Document folder
  • Email folder
  • Report folder
  • Dashboard folder

Folder type names end with the “Folder” suffix. For example, the type name of an email folder is “EmailFolder”.

File Suffix and Directory Location

Folders are stored in the corresponding component directory of the package. These directories are named documents, email, reports, and dashboards.  Folders do not have a text file representation—they are containers for files. For each folder, an accompanying metadata file named FolderName-meta.xml is created at the same directory level. The FolderName-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-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:
  • Shared. This folder is accessible only by the specified set of users.
  • Public. This folder is accessible by all users, including portal users.
  • PublicInternal. This folder is accessible by all users, excluding portal users. This setting is available for report and dashboard folders in organizations with a partner portal or Customer Portal enabled.
  • Hidden. This folder is hidden from all users.
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 will have to the contents of the folder. Valid values include:
  • ReadOnly. All users can read the contents of the folder, but no user can change the contents.
  • ReadWrite. All users can read or change the contents of the folder.
sharedTo SharedTo Sharing access for the folder. See “Sharing Considerations” in the Salesforce online 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>37.0</version>
10</Package>
The following is an example of the sampleFolder-meta.xml metadata file for the sampleFolder document folder:
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>