Represents a file that a User has uploaded and attached to a parent object.
create(), update(),delete(), query(), search(), retrieve(), getDeleted(), getUpdated(), describeSObjects()
| Field | Field Type | Field Properties | Description |
|---|---|---|---|
| Body | base64 | Create | Required. Encoded file data. |
| BodyLength | int | Filter | Size of the file (in bytes). |
| ContentType | string | Create | 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 | Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted. |
| IsPrivate | boolean | Create | 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 | Required. Name of the attached file. Label is File Name. |
| OwnerId | reference | Create | 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 | 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. |
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(), update(), and delete() calls. The query() call does not return attachments parented by email, unless the user performing the query has the “Modify All Data” permission.
Access to fields depends on the method being used:
When an attachment is added, updated, or deleted, the LastActivityUpdate for the parent is updated.