Represents a file that a user has uploaded. Unlike Attachment objects, Documents are not attached to a parent object.
create(), update(), delete(), query(), search(), retrieve(), getDeleted(), getUpdated(), describeSObjects()
You must have the “Edit” permission on documents and the appropriate access to the Folder that contains a document in order to create or update a document in that Folder.
| Field | Field Type | Field Properties | Description |
|---|---|---|---|
| AuthorID | reference | Create | ID of the User who is responsible for the Document. For information on IDs, see ID Field Type. |
| Body | base64 | Create | Required. Encoded file data. If specified, then do not specify a URL. |
| BodyLength | int | Filter | Size of the file (in bytes). |
| ContentType | string | Create | Type of content. Label is Mime Type.
Limit: 120 characters. If the Disallow HTML documents and attachments security setting is enabled for your organization, you cannot upload files with the following file extensions: htm, html, htt, htx, mhtm, mhtml, shtm, shtml, acgi. |
| Description | textarea | Create | Text description of the Document. Limit: 255 characters. |
| DeveloperName | string | Create | The unique name of the object in the API. The name can contain only alphanumeric characters and must begin with a letter. In managed packages, this field prevents naming conflicts on package installations. With this field, a developer can change the object's name in a managed package and the changes are reflected in a subscriber's organization. Label is Document Unique Name. |
| FolderId | reference | Create | Required. ID of the Folder that contains the Document. See Folder. |
| IsDeleted | boolean | Defaulted on create |
Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted. |
| IsInternalUseOnly | boolean | Create | Indicates whether the object is only available for internal use (true) or not (false). Label is Internal Use Only. |
| IsPublic | boolean | Create | Indicates whether the object is available for external use (true) or not (false). Label is Externally Available. |
| Keywords | string | Create | Keywords. Limit: 255 characters. |
| Name | string | Create | Required. Name of the document. Label is Document Name. |
| Type | string | Create | File type of the Document. In general, the values match the file extension for the type of Document (such as pdf or jpg). Label is File Extension. |
| URL | string | Create | URL reference to the file (instead of storing it in the database). If specified, do not specify the Body or BodyLength. |
When calling create() or update() for a document, a client application can specify a value in either the Body or URL fields, but not both.
The API sends and receives the binary file data encoded as a base64 data type. Prior to create(), clients must encode the binary file data as base64. Upon receiving an API response, clients must decode the base64 data to binary (this conversion is usually handled for you by the SOAP client).