Document

Represents a file that a user has uploaded. Unlike Attachment objects, Documents are not attached to a parent object.

Supported Calls

create(), update(), delete(), query(), search(), retrieve(), getDeleted(), getUpdated(), describeSObjects()

Special Access Rules

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.

Fields

Field Field Type Field Properties Description
AuthorID reference Create

Defaulted on create

Filter

Update

ID of the User who is responsible for the Document. For information on IDs, see ID Field Type.
Body base64 Create

Nillable

Update

Required. Encoded file data. If specified, then do not specify a URL.
BodyLength int Filter Size of the file (in bytes).
ContentType string Create

Filter

Nillable

Update

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

Filter

Nillable

Update

Text description of the Document. Limit: 255 characters.
DeveloperName string Create

Filter

Nillable

Update

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

Filter

Update

Required. ID of the Folder that contains the Document. See Folder.
IsDeleted boolean Defaulted on create

Filter

Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.

IsInternalUseOnly boolean Create

Defaulted on create

Filter

Update

Indicates whether the object is only available for internal use (true) or not (false). Label is Internal Use Only.
IsPublic boolean Create

Defaulted on create

Filter

Update

Indicates whether the object is available for external use (true) or not (false). Label is Externally Available.
Keywords string Create

Filter

Nillable

Update

Keywords. Limit: 255 characters.
Name string Create

Filter

idLookup

Update

Required. Name of the document. Label is Document Name.
Type

Create

Filter

Nillable

Update

string
Create

Filter

Nillable

Update

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

Filter

Nillable

Update

URL reference to the file (instead of storing it in the database). If specified, do not specify the Body or BodyLength.

Usage

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.

Encoded Data

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).

Maximum Document Size

The create() and update() calls restrict documents to a maximum size of 5 MB.

See Also:
Standard and Custom Object Basics
© Copyright 2000-2008 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.