Salesforce Dictionary — Free Salesforce GlossarySalesforce Dictionary
DictionaryAAttachment
Core CRMBeginner

Attachment

An Attachment in Salesforce is the legacy standard object (Attachment in the API) that stores a single file uploaded to a parent record through the classic Notes & Attachments related list.

§ 01

Definition

An Attachment in Salesforce is the legacy standard object (Attachment in the API) that stores a single file uploaded to a parent record through the classic Notes & Attachments related list. Each Attachment record contains the file's Name, binary Body (up to 25 MB, base64-encoded), ContentType (MIME type), BodyLength, a polymorphic ParentId pointing to almost any standard or custom record, an OwnerId, an IsPrivate flag, and an optional Description. Attachments are tightly coupled to a single parent — there is no built-in way to share one file across multiple records, and the file disappears if the parent record is deleted. Salesforce Files (ContentDocument and ContentVersion) replaced Attachments as the modern file-storage model, offering multi-record sharing, version history, preview rendering, external sync, and rich permission controls. Salesforce continues to support the Attachment object indefinitely for backward compatibility, but new file uploads through Lightning Experience and most current APIs default to Files instead.

§ 02

In plain English

👋 Study buddy

An Attachment is the original way Salesforce stored file uploads — a contract PDF on an Opportunity, a screenshot on a Case, a logo on an Account. Each Attachment record holds one file glued to one parent record. The newer Files feature does the same thing but better (one file can be shared with many records, has versions, and shows previews), so most new uploads now go through Files instead.

§ 03

Worked example

scenario · real-world use

A finance ops user uploads a signed contract PDF to an Opportunity in Salesforce Classic. The system creates an Attachment record with Name = "Acme_MSA_signed.pdf", a binary Body of ~800 KB, ContentType = "application/pdf", and ParentId pointing to the Opportunity. Anyone with read access to the Opportunity can download the PDF from the Notes & Attachments related list. Three years later the org migrates to Lightning Experience — the Attachment continues to display in the unified Files & Attachments view on the Opportunity. When a new contract is uploaded today through Lightning, it lands as a ContentDocument (Salesforce File) instead of an Attachment, but the historical Attachment record stays put.

§ 04

Why Attachment matters

Attachment storage counts against the org's File Storage allocation, which is allocated separately from Data Storage. Each Salesforce edition includes a base allotment plus a per-user multiplier — running out of file storage is a common surprise in older orgs with high Attachment volume. Attachment Bodies are stored base64-encoded, which means a 1 MB raw file consumes roughly 1.33 MB of storage when measured against the limit. Bulk export of Attachments through the Bulk API is a common data-archival pattern for orgs cleaning up legacy storage.

The Attachment object's tight one-to-one parent relationship is its single biggest limitation compared to Files. You cannot link the same Attachment to two records — the same file uploaded to ten Opportunities means ten Attachment records, each consuming its own storage. ContentDocument solves this through ContentDocumentLink junction records, allowing one underlying file to be shared with many records and many users, each with its own access level (Viewer, Collaborator, Owner).

Permissions follow the parent record's sharing model, with the IsPrivate flag adding a single-owner restriction (similar to classic Notes). There is no field-level security on Attachment, no folder structure, no version history beyond replacing the file (which deletes the previous version's data), and no preview rendering — clicking an Attachment downloads it. These gaps are why Salesforce Files exists, and why almost all modern documentation assumes Files unless explicitly discussing legacy Classic behavior.

§ 05

How organizations use Attachment

Long-tenured Salesforce Classic org

Has hundreds of thousands of Attachment records accumulated over a decade — contracts, screenshots, customer-uploaded artwork, scanned documents. After moving to Lightning, the team still relies on those Attachments for historical context but routes all new uploads through Files. A periodic data-archive job exports old Attachments to S3 and deletes them to free File Storage.

Customer support team using Email-to-Case

In older Email-to-Case configurations, inbound email attachments were saved as classic Attachment records on the Email Message. Modern Email-to-Case (Enhanced Email) saves them as ContentDocument instead — but the legacy Attachments still appear on archived Cases and continue to work normally.

Salesforce admin running an org-wide cleanup

Queries Attachment via Data Loader to find oversized binary uploads (Attachments where BodyLength > 5 MB) that account for a disproportionate share of File Storage. Reviews them for archival or migration to Files with full ContentDocumentLink wiring before deleting the originals.

§

Trust & references

Official documentation

Straight from the source — Salesforce's reference material on Attachment.

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.
§

Discussion

Loading…

Loading discussion…