Attachment

Represents a file that a User has uploaded and attached to a parent object.

Supported Calls

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

Fields

Field Field Type Field Properties Description
Body base64 Create

Update

Required. Encoded file data.
BodyLength int Filter

Nillable

Size of the file (in bytes).
ContentType string Create

Filter

Nillable

Update

The content type of the attachment.

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.

IsDeleted boolean Defaulted on create

Filter

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

Defaulted on create

Filter

Update

Indicates whether this record is viewable only by the owner and administrators (true) or viewable by all otherwise-allowed users (false). During a create() or update() call, it is possible to mark an Attachment record as private even if you are not the owner. This can result in a situation in which you can no longer access the record that you just inserted or updated. Label is Private.
Name string Create

Filter

idLookup

Update

Required. Name of the attached file. Label is File Name.
OwnerId reference Create

Defaulted on create

Filter

Update

ID of the User who owns the attachment. For information on IDs, see ID Field Type. This field was required previous to release 9.0. Beginning with release 9.0, it can be null on create.
ParentId reference Create

Filter

Required. ID of the parent object of the attachment. The following objects are supported as parents of attachments:

For information on IDs, see ID Field Type.

Usage

The API sends and receives the binary file attachment data encoded as a base64Binary data type. Prior to create(), client applications must encode the binary attachment data as base64. Upon receiving a response, client applications must decode the base64 data to binary (this conversion is usually handled for you by the SOAP client).

The create() call restricts these files to a maximum size of 5 MB. For a file attached to a Solution, the limit is 1.5MB. The maximum email attachment size is 3 MB.

The API supports attachments on email in create(), delete(), and update() calls. The query() call does not return attachments parented by email, unless the user performing the query has the “Modify All Data” permission.

Note
The search() call does not search Attachment records during text searches.

Access to fields depends on the method being used:

© Copyright 2000-2009 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.