---
id: object/table/1222
type: object
title: Table 1222 "Data Exch. Def"
summary: Table 1222 "Data Exch. Def" in Base Application (System.IO). 17 fields, 9 public procedures. Present since at least BC23, still in BC30, changed in BC24.
tier: official
language: en
tags:
  - table
  - base application
versions:
  introduced: null
  last_changed: "24"
  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: 8061e8066963b404543d942e5e2d32096b2ed98f12c3cf8d558b89ad59b3c1af
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/System/DataExchange/DataExchDef.Table.al
    title: src/Layers/W1/BaseApp/System/DataExchange/DataExchDef.Table.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn:
    - https://learn.microsoft.com/dynamics365/business-central/across-how-to-set-up-data-exchange-definitions
  objects: []
  features: []
  topics:
    - topic/business-central/business-functionality/general-business-functionality/exchange-data-electronically/exchange-data
  localizations:
    - localization/ca
    - localization/mx
    - localization/ru
    - localization/us
  videos: []
  posts: []
  guidelines: []
object_type: table
object_id: 1222
name: Data Exch. Def
namespace: System.IO
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
source_major: "29"
obsolete: null
countries:
  - ca
  - mx
  - ru
  - us
ms_search_form_ids: []
counts:
  fields: 17
  procedures: 9
  events: 0
  subscribers: 0
relations:
  out: 2
  referenced_by: 24
  pages: 2
  extended_by: 0
  event_subscribers: 0
  calls: 0
  called_by: 0
  implements: 0
---

# Table 1222 "Data Exch. Def"

> Table 1222 "Data Exch. Def" in Base Application (System.IO). 17 fields, 9 public procedures. Present since at least BC23, still in BC30, changed in BC24.

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

Learn documents this table through its pages: [Page 1210 "Data Exch Def Card"](../page/1210.md) (1 Learn page), [Page 1211 "Data Exch Def List"](../page/1211.md) (1).

## Properties

| Property | Value |
|---|---|
| Caption | Data Exch. Def |
| DataClassification | CustomerContent |
| LookupPageId | Data Exch Def List |
| DrillDownPageId | Data Exch Def List |

## 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 | Code | Code[20] | Specifies a code that identifies the data exchange setup. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | NotBlank |
| 2 | Name | Text[100] | Specifies the name of the data exchange definition. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> |  |
| 3 | Type | Enum "Data Exchange Definition Type" | Specifies what type of exchange the data exchange definition is used for. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | enum [Enum 1222 "Data Exchange Definition Type"](../enum/1222.md) |
| 4 | Reading/Writing XMLport | Integer | Specifies the XMLport through which an imported data file or service enters prior to mapping and through which exported data exits when it is written to a data file or service after mapping. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(XMLport)) |
| 5 | Header Lines | Integer | Specifies how many header lines exist in the file. This ensures that the header data is not imported. This field is only relevant for import. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> |  |
| 8 | Header Tag | Text[250] | Specifies the text of the first column on the header line. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> |  |
| 9 | Footer Tag | Text[250] | Specifies the text of the first column on the footer line. If a footer line exists in several places in the file, enter the text of the first column on the footer line to ensure that the footer data is not imported. This field is only relevant for import. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> |  |
| 10 | Column Separator | Option | Specifies how columns in the file are separated if the file is of type Variable Text. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | OptionCaption: ,Tab,Semicolon,Comma,Space,Custom |
| 11 | File Encoding | Option | Specifies the encoding of the file to be imported. This field is only relevant for import. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | OptionCaption: MS-DOS,UTF-8,UTF-16,WINDOWS |
| 13 | File Type | Option | Specifies what type of file the data exchange definition is used for. You can select between three file types. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | OptionCaption: Xml,Variable Text,Fixed Text,Json |
| 14 | Ext. Data Handling Codeunit | Integer | Specifies the codeunit that transfers external data in and out of the Data Exchange Framework. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Codeunit)) |
| 15 | Reading/Writing Codeunit | Integer | Specifies the codeunit that processes imported data prior to mapping and exported data after mapping. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Codeunit)) |
| 16 | Validation Codeunit | Integer | Specifies the codeunit that is used to validate data against pre-defined business rules. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Codeunit)) |
| 17 | Data Handling Codeunit | Integer | Specifies the codeunit that transfers data in and out of tables in Microsoft Dynamics 365. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Codeunit)) |
| 18 | User Feedback Codeunit | Integer | Specifies the codeunit that does various clean-up after mapping, such as marks the lines as exported and deletes temporary records. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | TableRelation AllObjWithCaption."Object ID" where("Object Type" = const(Codeunit)) |
| 19 | Custom Column Separator | Text[10] | Specifies how columns in the file are separated if the file is of a custom type. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> |  |
| 20 | Line Separator | Option | Specifies how lines in the file are separated if the file is of type Variable Text. <small>via [Page 1210 "Data Exch Def Card"](../page/1210.md)</small> | OptionCaption: CRLF,CR,LF |

## Keys

- Key1: Code (clustered)
- Key2: Type

## Procedures

- `InsertRec(NewCode: Code[20]; NewName: Text[100]; NewType: Enum "Data Exchange Definition Type"; ProcessingXMLport: Integer; HeaderCount: Integer; HeaderTag: Text[250]; FooterTag: Text[250])`
- `InsertRecForExport(NewCode: Code[20]; NewName: Text[100]; NewType: Option; ProcessingXMLport: Integer; FileType: Option)`
- `ColumnSeparatorChar(): Text`
- `CheckEnableDisableIsNonXMLFileType(): Boolean`
- `CheckEnableDisableIsImportType(): Boolean`
- `CheckEnableDisableIsBankStatementImportType(): Boolean`
- `CheckEnableDisableDelimitedFileType(): Boolean`
- `PositivePayUpdateCodeunits(): Boolean`
- `ProcessDataExchange(var DataExch: Record "Data Exch.")`

## Triggers

OnDelete, OnInsert

## Relations

- drill-down page [Page 1211 "Data Exch Def List"](../page/1211.md)
- lookup page [Page 1211 "Data Exch Def List"](../page/1211.md)

## Referenced by

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

- [Table 4810 "Intrastat Report Setup"](../table/4810.md): Data Exch. Def. Name, Data Exch. Def. Name - Receipt, Data Exch. Def. Name - Shpt., Data Exch. Def. Code, Data Exch. Def. Code - Receipt, Data Exch. Def. Code - Shpt.
- [Table 6139 "E-Doc. Service Data Exch. Def."](../table/6139.md): Expt. Data Exchange Def. Name, Impt. Data Exchange Def. Name, Expt. Data Exchange Def. Code, Impt. Data Exchange Def. Code
- [Table 1200 "Bank Export/Import Setup"](../table/1200.md): Data Exch. Def. Name, Data Exch. Def. Code
- [Table 1213 "Data Exchange Type"](../table/1213.md): Data Exch. Def. Code
- [Table 1220 "Data Exch."](../table/1220.md): Data Exch. Def Code
- [Table 1223 "Data Exch. Column Def"](../table/1223.md): Data Exch. Def Code
- [Table 1224 "Data Exch. Mapping"](../table/1224.md): Data Exch. Def Code
- [Table 1225 "Data Exch. Field Mapping"](../table/1225.md): Data Exch. Def Code
- [Table 1227 "Data Exch. Line Def"](../table/1227.md): Data Exch. Def Code
- [Table 1238 "Data Exch. Field Grouping"](../table/1238.md): Data Exch. Def Code
- [Table 1650 "Curr. Exch. Rate Update Setup"](../table/1650.md): Data Exch. Def Code
- [Table 5010 "Service Declaration Setup"](../table/5010.md): Data Exch. Def. Code
- [Table 6121 "E-Document"](../table/6121.md): Data Exch. Def. Code
- [Table 8017 "Generic Import Settings"](../table/8017.md): Data Exchange Definition
- [Table 98 "General Ledger Setup"](../table/98.md): Payroll Trans. Import Format

## Pages and codeunits on this table

- [Page 1210 "Data Exch Def Card"](../page/1210.md) (source table)
- [Page 1211 "Data Exch Def List"](../page/1211.md) (source table)

## Across versions

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

## Countries that replace it

[CA](../../localizations/ca.md), [MX](../../localizations/mx.md), [RU](../../localizations/ru.md), [US](../../localizations/us.md)

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). 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: "Data Exch. Def")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
