Document

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

Version 

Introduced in API version 38.0.

Supported SOAP API Calls 

delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete()

Supported REST API Methods 

DELETE, GET, HEAD, Query

Limitations 

SOSL Limitations

Fields 

AuthorId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: ID of the user who is responsible for the document.

  • Relationship name: Author

  • Relationship type: relationship

  • Refers to: User

Body 

  • Type: base64

  • Required: No

  • Properties: Nillable

  • Description: Required. Encoded file data. If specified, then do not specify a URL.

BodyLength 

  • Type: int

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: Size of the file (in bytes). If specified, then do not specify a URL.

ContentType 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Introduced: API version 6.0

  • Description: Type of content. Label is Mime Type. Limit: 120 characters.

If the Don't allow HTML uploads as attachments or document records 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, .svg.

Description 

  • Type: textarea

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: Text description of the document. Limit: 255 characters.

DeveloperName 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Sort

  • Introduced: API version 14.0

  • Description: The unique name of the object in the API. This name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores. 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.

    When creating large sets of data, always specify a unique DeveloperName for each record. If no DeveloperName is specified, performance may slow while Salesforce generates one for each record.

    Note

FolderId 

  • Type: reference

  • Required: No

  • Properties: Filter, Group, Sort

  • Description: Required. ID of the folder that contains the document.

  • Relationship name: Folder

  • Relationship type: polymorphic

  • Refers to: Folder, User

FullName 

  • Type: string

  • Required: No

  • Properties: Create, Group, Nillable

  • Introduced: API version 38.0

  • Description: The full name of the associated metadata object in Metadata API. Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

IsBodySearchable 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort

  • Introduced: API version 15.0

  • Description: Indicates whether the contents of the object can be searched using a SOSL FIND call. The ALL FIELDS search group includes the content as a searchable field.

  • Default value: false

IsInternalUseOnly 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort

  • Description: Indicates whether the object is only available for internal use (true) or not (false). Label is Internal Use Only.

  • Default value: false

IsPublic 

  • Type: boolean

  • Required: No

  • Properties: Defaulted on create, Filter, Group, Sort

  • Introduced: API version 7.0

  • Description: Indicates whether the object is available for external use (true) or not (false). Label is Externally Available.

  • Default value: false

Keywords 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: Keywords. Limit: 255 characters.

ManageableState 

  • Type: picklist

  • Required: No

  • Properties: Filter, Group, Nillable, Restricted picklist, Sort

  • Description: Indicates the manageable state of the specified component that is contained in a package:

  • beta

  • deleted

  • deprecated

  • deprecatedEditable

  • installed

  • installedEditable

  • released

  • unmanaged

  • Possible values:

    • beta — beta

    • deleted — deleted

    • deprecated — deprecated

    • deprecatedEditable — deprecatedEditable

    • installed — installed

    • installedEditable — installedEditable

    • released — released

    • unmanaged — unmanaged

Metadata 

  • Type: complexvalue

  • Required: No

  • Properties: Create, Nillable, Update

  • Introduced: API version 38.0

  • Description: The metadata for this object as defined in the Metadata API. Query this field only if the query result contains no more than one record. Otherwise, an error is returned. If more than one record exists, use multiple queries to retrieve the records. This limit protects performance.

Name 

  • Type: string

  • Required: No

  • Properties: Filter, Group, idLookup, Sort

  • Description: Required. Name of the document. Label is Document Name.

NamespacePrefix 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Introduced: API version 14.0

  • Description: The namespace prefix that is associated with this object. Each Developer Edition org that creates a managed package has a unique namespace prefix. Limit: 15 characters. You can refer to a component in a managed package by using the namespacePrefix__componentName notation.

The namespace prefix can have one of the following values.

  • In Developer Edition orgs, NamespacePrefix is set to the namespace prefix of the org for all objects that support it, unless an object is in an installed managed package. In that case, the object has the namespace prefix of the installed managed package. This field’s value is the namespace prefix of the Developer Edition org of the package developer.
  • In orgs that are not Developer Edition orgs, NamespacePrefix is set only for objects that are part of an installed managed package. All other objects have no namespace prefix.

Type 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

  • Description: 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 

  • Type: string

  • Required: No

  • Properties: Filter, Group, Nillable, Sort

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

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!