---
id: object/table/5062
type: object
title: Table 5062 "Attachment"
summary: Table 5062 "Attachment" in Base Application (Microsoft.CRM.Interaction). 13 fields, 33 public procedures, 9 events. Present since at least BC23, still in BC30, changed in BC24-27.
tier: official
language: en
tags:
  - table
  - base application
versions:
  introduced: null
  last_changed: "27"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: a3e0c4b9f8d84c9720b992a37d90b0d8118edcd681da5bca4b1eb4bdb925f1ba
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al
    title: src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
object_type: table
object_id: 5062
name: Attachment
namespace: Microsoft.CRM.Interaction
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
  - "27"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 13
  procedures: 50
  events: 9
  subscribers: 0
relations:
  out: 0
  referenced_by: 4
  pages: 0
  extended_by: 1
  event_subscribers: 0
  calls: 6
  called_by: 0
  implements: 0
---

# Table 5062 "Attachment"

> Table 5062 "Attachment" in Base Application (Microsoft.CRM.Interaction). 13 fields, 33 public procedures, 9 events. Present since at least BC23, still in BC30, changed in BC24-27.

Base Application · Microsoft.CRM.Interaction · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/CRM/Interaction/Attachment.Table.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Caption | Attachment |
| DataClassification | CustomerContent |

## Fields

Explanation: the field's ToolTip in the code; without one, the ToolTip of a page control bound to the field (marked via the page); without that, its Caption (marked caption) when that differs from the name.

| No. | Name | Type | Explanation | Notes |
|---|---|---|---|---|
| 1 | No. | Integer | — | NotBlank |
| 2 | Attachment File | BLOB | — |  |
| 3 | Storage Type | Enum "Attachment Storage Type" | — | enum [Enum 5062 "Attachment Storage Type"](../enum/5062.md) |
| 4 | Storage Pointer | Text[250] | — |  |
| 5 | File Extension | Text[250] | — |  |
| 6 | Read Only | Boolean | — |  |
| 7 | Last Date Modified | Date | — |  |
| 8 | Last Time Modified | Time | — |  |
| 13 | Merge Source | BLOB | — |  |
| 14 | Email Message ID | BLOB | — |  |
| 15 | Email Entry ID | BLOB | — |  |
| 16 | Email Message Checksum | Integer | — |  |
| 17 | Email Message Url | BLOB | — |  |

## Keys

- Key1: No. (clustered)
- Key2: Email Message Checksum

## Events published

- `OnAfterCopyAttachmentAsFile(var FromAttachment: Record Attachment; var ToAttachment: Record Attachment)` (integration)
- `OnBeforeShowAttachment(var SegLine: Record "Segment Line"; WordCaption: Text; var IsHandled: Boolean; var Attachment: Record Attachment)` (integration)
- `OnBeforeExportAttachmentToServerFile(var Attachment: Record Attachment; ExportToFile: Text; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeImportAttachmentFromServerFile(var Attachment: Record Attachment; ImportFromFile: Text; var Result: Boolean; IsTemporary: Boolean; Overwrite: Boolean; var IsHandled: Boolean)` (integration)
- `OnShowAttachmentOnAfterCalcAttachmentFile(var Attachment: Record Attachment)` (integration)
- `OnBeforeOpenAttachment(var Attachment: Record Attachment; var Caption: Text[260]; IsTemporary: Boolean; LanguageCode: Code[10]; var IsHandled: Boolean)` (integration)
- `OnBeforeWizSaveAttachment(var Attachment: Record Attachment; var IsHandled: Boolean)` (integration)
- `OnBeforeWizEmbeddAttachment(var Attachment: Record Attachment; FromAttachment: Record Attachment; var IsHandled: Boolean)` (integration)
- `OnBeforeConstDiskFileName(var Attachment: Record Attachment; var DiskFileName: Text)` (integration)

## Procedures

- `OpenAttachment(Caption: Text[260]; IsTemporary: Boolean; LanguageCode: Code[10])`
- `OpenAttachment(var SegmentLine: Record "Segment Line"; WordCaption: Text)`
- `InsertRecord()`
- `ShowAttachment(var SegLine: Record "Segment Line"; WordCaption: Text)`
- `ExportAttachmentToClientFile(var ExportToFile: Text): Boolean`
- `ImportAttachmentFromClientFile(ImportFromFile: Text; IsTemporary: Boolean; IsInherited: Boolean): Boolean`
- `ExportAttachmentToServerFile(var ExportToFile: Text): Boolean`
- `ExportAttachmentToTempBlob(var TempBlob: Codeunit "Temp Blob"): Boolean`: Export the Attachment to the TempBlob Codeunit.
- `ImportAttachmentFromServerFile(ImportFromFile: Text; IsTemporary: Boolean; Overwrite: Boolean): Boolean`
- `ImportAttachmentFromStream(InStream: InStream; FileExtension: Text): Integer` (internal)
- `RemoveAttachment(Prompt: Boolean): Boolean`
- `WizEmbeddAttachment(FromAttachment: Record Attachment)`
- `WizSaveAttachment()`
- `ConstDiskFileName(): Text`
- `LinkToMessage(MessageID: Text; EntryID: Text; RunTrigger: Boolean)`
- `Checksum(MessageID: Text): Integer`
- `GetMessageID(): Text`
- `SetMessageID(MessageID: Text)`
- `SetEntryID(EntryID: Text)`
- `GetEmailMessageUrl(): Text`
- `SetEmailMessageUrl(Url: Text)`
- `Read(): Text`
- `Write(SourceText: Text)`
- `ReadHTMLCustomLayoutAttachment(var ContentBodyText: Text; var CustomLayoutCode: Code[20]): Boolean`
- `ReadHTMLCustomLayoutAttachment(var ContentBodyText: Text; var CustomLayoutCode: Code[20]; var ReportLayoutName: Text[250]): Boolean`
- `WriteHTMLCustomLayoutAttachment(ContentBodyText: Text; CustomLayoutCode: Code[20])`
- `WriteHTMLCustomLayoutAttachment(ContentBodyText: Text; ReportLayoutName: Text[250])`
- `IsHTML(): Boolean`
- `IsHTMLReady(): Boolean`
- `IsHTMLCustomLayout(): Boolean`
- `GetServerFileName(DiskFileName: Text): Text`
- `SetAttachmentFileFromBlob(TempBlob: Codeunit "Temp Blob")`
- `SetAttachmentFileFromStream(InStream: InStream)` (internal)

Plus 8 local procedures.

## Triggers

OnInsert, OnModify

## Referenced by

4 fields in 4 objects relate to this table (TableRelation or CalcFormula).

- [Table 5065 "Interaction Log Entry"](../table/5065.md): Attachment No.
- [Table 5074 "Delivery Sorter"](../table/5074.md): Attachment No.
- [Table 5077 "Segment Line"](../table/5077.md): Attachment No.
- [Table 5196 "To-do Interaction Language"](../table/5196.md): Attachment No.

## Extended by

- [Table extension 1680 "Attachment Internet Message Id"](../tableextension/1680.md)

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 419 "File Management"](../codeunit/419.md) (17 calls: `ExportAttachmentToClientFile → DeleteServerFile`, `ExportAttachmentToClientFile → Magicpath`, `ExportAttachmentToClientFile → ServerTempFileName`, …)
- [Codeunit 4100 "Temp Blob"](../codeunit/4100.md) (4 calls: `ExportAttachmentToServerFile → FromRecord`, `ExportAttachmentToTempBlob → FromRecord`, `ProcessWebAttachment → FromRecord`, …)
- [Codeunit 5052 "AttachmentManagement"](../codeunit/5052.md) (2 calls: `ImportAttachmentFromClientFile → InsertAttachment`, `PreviewHTMLContent → LoadHTMLContent`)
- [Codeunit 5069 "Word Template Interactions"](../codeunit/5069.md) (2 calls: `ShowAttachment → IsWordDocumentExtension`, `ShowAttachment → RunMergedDocument`)
- [Codeunit 9500 "Sequence No. Mgt."](../codeunit/9500.md) (2 calls: `InsertRecord → GetNextSeqNo`, `InsertRecord → RebaseSeqNo`)
- [Codeunit 4030 "Client Type Management"](../codeunit/4030.md) (1 call: `OpenAttachment → GetCurrentClientType`)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-27

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "table", object_name: "Attachment")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
