Study guide
7.1 XMLport Architecture, Formats & Properties
Microsoft Dynamics 365 Business Central Developer MB-820
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Business Central Architecture & Platform Foundation
1.1 Business Central Architecture & Extensions Model 1.2 Customization Lifecycle: Cloud (SaaS) vs. On-Premises 1.3 Base Application, System Application & AppSource
2 Chapter 2: Development Environment & Configuration
2.1: Development Environment Setup: VS Code, AL: Go! Projects & Sandboxes 2.2: AL Configuration Files: app.json & launch.json Parameters 2.3: Multi-Root Workspaces & Project Dependencies
3 Chapter 3: Extension Lifecycle: Debugging, Deployment, Multilanguage & Maintenance
3.1 Debugging & Snapshot Debugging in Visual Studio Code 3.2 Extension Deployment & Schema Synchronization Modes 3.3 Multilanguage Development with XLIFF & Translation Files 3.4 Extension Maintenance, Deprecation & Breaking Changes
4 Chapter 4: Tables, Table Extensions & Data Modeling
4.1: Building Tables, Fields, Keys & Data Types 4.2: Table Extensions & Table Modifications 4.3: FlowFields, FlowFilters & Table Relations 4.4: Enums, Enum Extensions & Extensible Types
5 Chapter 5: Pages, Page Extensions & Role Centers
5.1: Page Types, Anatomy & Control Structure 5.2: Building Card, List & Document Pages 5.3: Page Extensions & Page Customizations 5.4: Role Centers, Headlines & Cue Data Modeling
6 Chapter 6: Reports & Document Generation
6.1 Report Architecture, DataItems & Dataset Design 6.2 Report Layouts: RDLC, Word, Excel & Multilanguage 6.3 Document Reports & Request Page Programming 6.4 Processing-Only Reports & Report Substitutions
7 Chapter 7: XMLports & Data Exchange
7.1 XMLport Architecture, Formats & Properties 7.2 XMLport Node Hierarchy, Triggers & Stream Manipulation
8 Chapter 8: Codeunits, Events, Triggers & Interfaces
8.1 Codeunit Types, Execution & SingleInstance Codeunits 8.2 Events, Publishers, Subscribers & Event Isolation 8.3 Interfaces, Polymorphism & Dynamic Codeunit Invocation 8.4 Installation & Upgrade Codeunits, Data Transfer & Archive
9 Chapter 9: Entitlements, Permissions & Queries
9.1 Permission Sets & Permission Set Extensions 9.2 Inherent Permissions, Inherent Entitlements & Security Scoping 9.3 Query Objects: Joins, Aggregation & Query as Report Data Source
10 Chapter 10: UI Customization, User Assistance & Onboarding
10.1 Profile Objects & Custom Page Views in AL 10.2 User Assistance: ToolTips, Teaching Tips & In-App Tours 10.3 Assisted Setup, Guided Experience & Onboarding Checklists
11 Chapter 11: Business Central Design Patterns & Data Process Model
11.1 Functional Table Types: Master Data, Supplemental & Setup Patterns 11.2 Document Standards: Header, Line, History & Journal Architectures 11.3 Data Process Model & Posting Routine Architecture
12 Chapter 12: AL Language Fundamentals, Data Types & Variables
12.1 AL Syntax, Variable Scope, Primitive & Complex Data Types 12.2 Expressions, Control Flow Statements & Built-in Functions 12.3 Access Modifiers (Public, Internal, Local) & Code Scoping
13 Chapter 13: Data Manipulation, Streams & Error Handling
13.1 Record Operations: Get, FindSet, ModifyAll & Filter Functions 13.2 Streams, File Management & TempBlob 13.3 Error Handling: ErrorInfo, TryFunctions & Collectible Errors
14 Chapter 14: Testing, Test Toolkit & Automation
14.1 Testing Architecture & the Test Toolkit 14.2 Authoring Test Codeunits & UI Handler Functions
15 Chapter 15: Telemetry, Performance Optimization & Analyzers
15.1 Telemetry Configuration & Azure Application Insights 15.2 Custom Telemetry Signals with Session.LogMessage & KQL 15.3 Performance Profiler, SetLoadFields & Query Optimization 15.4 AL Analyzers: CodeCop, AppSourceCop, UICop & PTECop
16 Chapter 16: REST Web Services & JSON in AL
16.1 HttpClient, HttpRequestMessage & REST API Consumption 16.2 JSON Processing: JsonObject, JsonArray, JsonValue & JsonToken
17 Chapter 17: API Pages, OData, Read Scale-Out & OAuth
17.1 API Pages (PageType=API), OData Web Services & REST Endpoints 17.2 Bound and Unbound OData Actions with [ServiceEnabled] 17.3 Read Scale-Out Architecture & DataAccessIntent Configuration 17.4 Microsoft Entra ID App Registrations & OAuth 2.0 Integration
7.1 XMLport Architecture, Formats & Properties
Key Takeaways Explain This Topic AI
XMLports are specialized AL application objects engineered for high-throughput, bidirectional data exchange supporting hierarchical XML, delimited text (CSV/TSV), and fixed-width flat files.
The Format property determines the serialization engine: Xml builds nested element/attribute trees with namespace support, VariableText parses delimited text lines, and FixedText processes positional column-width records.
The Direction property strictly enforces runtime invocation boundaries (Import, Export, Both), while TextEncoding (UTF8, UTF16, WINDOWS, MS-DOS) governs byte-to-character translation across modern and legacy external systems.
Delimiter properties (FieldSeparator, FieldDelimiter, RecordSeparator, TableSeparator) define parsing tokens in flat files, supporting special escape tokens such as <TAB>, <None>, and <NewLine>.
DefaultFieldsValidation controls whether table-level OnValidate triggers execute globally during import, which can be overridden at the field level using FieldValidate on individual fieldelements.
Last updated: August 2026
7.1 XMLport Formats, Properties & Direction
In Microsoft Dynamics 365 Business Central, XMLports are dedicated AL application objects used to import and export structured business data between Business Central database tables and external systems or flat files. While modern integration architectures frequently leverage REST APIs and OData web services, XMLports remain the core engine for high-throughput batch file processing, legacy electronic data interchange (EDI), automated banking and payroll interfaces, and electronic document exchange (such as PEPPOL or custom XML invoices).
For developers preparing for the MB-820 certification exam, mastering XMLport object architecture, serialization formats, delimiter mechanics, character encoding standards, and runtime validation properties is essential under Domain 3 ( Develop by using AL objects ).
1. XMLport Object Architecture in AL
An XMLport is declared using the xmlport keyword followed by a unique object ID and name. The structure consists of top-level object properties, an optional requestpage block, a mandatory schema block defining the hierarchical or tabular data layout, and AL triggers. xmlport 50120 "Export Customer CSV"
- {
- Caption = 'Export Customer CSV';
- Format = VariableText;
- Direction = Export;
- FieldSeparator = ',';
- FieldDelimiter = '"';
- RecordSeparator = '<NewLine>';
- TableSeparator = '<<NewLine><NewLine>>';
- TextEncoding = UTF8;
- UseRequestPage = true;
- DefaultFieldsValidation = true;
- schema
- {
- textelement(RootNode)
- {
- tableelement(Customer; Customer)
- {
- RequestFilterFields = "No.", "Customer Posting Group";
- SourceTableView = sorting("No.") where(Blocked = const(" "));
- fieldelement(CustomerNo; Customer."No.") { }
- fieldelement(Name; Customer.Name) { }
- fieldelement(BalanceLCY; Customer."Balance (LCY)") { }
- fieldelement(City; Customer.City) { }
- }
- }
- }
- requestpage
- {
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
- // Custom user filters or execution parameters
- }
- }
- }
- }
- }
Loading diagram... XMLport Data Exchange Architecture
2. Core XMLport Formats: XML, VariableText & FixedText
The Format property dictates how the XMLport serialization engine processes raw bytes into structured schema nodes.
Format = Xml (Default)
Designed for hierarchical data structures representing structured XML documents.
Supports nested elements ( textelement , tableelement , fieldelement ) and element attributes ( textattribute , fieldattribute ).
Honors XML namespaces defined in the Namespaces property.
Ideal for standardized data interchange schemas such as PEPPOL BIS 3.0 electronic invoices, ISO 20022 financial messages, and SOAP-style payloads.
Format = VariableText
Designed for delimited flat files such as Comma-Separated Values (CSV), Tab-Separated Values (TSV), and pipe-delimited files.
Fields within each record are separated by the FieldSeparator string and optionally wrapped in quotes by the FieldDelimiter string.
Delimited records do not maintain parent-child tag hierarchies; each record maps directly to a tabular row.
Widely used for importing bank transaction statements, external e-commerce sales feeds, and general ledger journal batches.
Format = FixedText
Designed for positional, fixed-column-width text files (e.g., legacy mainframe feeds, NACHA ACH banking files, and standardized payroll flat files).
Delimiters between fields are not used; instead, the parser determines the start and length of each field based on the Width property declared on each schema element.
Records must conform strictly to predefined column widths. If an incoming value exceeds or is shorter than the configured width, padding or truncation occurs according to the element data type.
3. Delimiter & Separator Properties
When Format is set to VariableText or FixedText , delimiter properties define how the runtime identifies record and field boundaries.
Property Format Applicability Default Value Description & Common Settings
FieldSeparator VariableText <,> (Comma) Specifies the character or string separating adjacent fields within a record. Common options include <TAB> , <;> , <|> , or custom strings. In AL, special characters can be specified using escaped notation.
FieldDelimiter VariableText <"> (Double Quote) Specifies the quoting character enclosing string fields containing special characters or spaces. Can be explicitly set to <None> if fields must not be enclosed in quotes.
RecordSeparator VariableText , FixedText <NewLine> (CRLF / \r\n ) Specifies the character sequence terminating an individual record row. Custom values can include <CR> , <LF> , or specific control characters.
TableSeparator VariableText , FixedText <<NewLine><NewLine>> Specifies the token inserted between distinct tables when an XMLport exports multiple unrelated tableelement structures sequentially. // Example: Pipe-Delimited Flat File Export without Quoting
- xmlport 50121 "Export Pipe Delimited Items"
- {
- Format = VariableText;
- Direction = Export;
- FieldSeparator = '|';
- FieldDelimiter = '<None>';
- RecordSeparator = '<NewLine>';
- TextEncoding = UTF8;
- schema
- {
- textelement(Root)
- {
- tableelement(Item; Item)
- {
- fieldelement(ItemNo; Item."No.") { }
- fieldelement(Description; Item.Description) { }
- fieldelement(UnitPrice; Item."Unit Price") { }
- fieldelement(Inventory; Item.Inventory) { }
- }
- }
- }
- }
- 4. Direction, Encoding & Validation Properties
- Direction
The Direction property controls the permissible execution mode of the XMLport:
Both (Default): The XMLport can be invoked to import external data into Business Central or export database records to an output stream.
Import : The XMLport can only be executed in import mode (e.g., Xmlport.Import(...) or interactive import). Attempting to call Xmlport.Export(...) on an Import-only XMLport throws a runtime error.
Export : The XMLport is strictly constrained to exporting data. Attempting to call Xmlport.Import(...) throws a runtime error.
TextEncoding
When reading or writing file streams, character encoding determines how binary bytes are translated into characters. The TextEncoding property supports four options:
UTF8 (Default): Standard 8-bit variable-width Unicode encoding. Preferred for modern cloud interfaces, XML documents, and international CSV files.
UTF16 : 16-bit Unicode encoding, commonly used in Windows-native architectures and specialized XML schemas requiring full UCS-2/UTF-16 support.
WINDOWS : Uses the Windows ANSI code page corresponding to the active server locale (typically Windows-1252 for Western European/US). Essential when exchanging files with legacy Windows desktop software.
MS-DOS : Uses the legacy OEM/DOS code page (such as CP437 or CP850). Required when interfacing with legacy POS hardware, barcode scanners, or older banking mainframe protocols.
DefaultFieldsValidation
When DefaultFieldsValidation = true (default), assigning values to table fields during an import automatically triggers the field's OnValidate trigger in AL. This guarantees that business rules (such as checking blocked status, validating relationships, and calculating dependent fields) are enforced.
When DefaultFieldsValidation = false , values are copied directly into the record buffer without executing field-level validation triggers. This mode is used for high-speed bulk data migration where source data is pre-validated, or where validation rules would cause circular dependency errors during initial import.
Developers can override this default on a per-field basis using the FieldValidate property on individual fieldelement nodes.
UseRequestPage
When UseRequestPage = true (default), running the XMLport interactively displays a modal request page where users can define sorting keys, apply table filters, and toggle execution options.
When UseRequestPage = false , the XMLport runs headlessly without rendering a user interface. This is critical for automated background processes, Job Queue entries, and API integrations where modal UI calls cause runtime exceptions.
5. Architectural Comparison of XMLport Formats
Architectural Attribute Format = Xml Format = VariableText Format = FixedText
Data Structure Hierarchical tree with nested parent-child nodes Two-dimensional tabular delimited rows Two-dimensional tabular fixed-width rows
Attribute Support Supports fieldattribute and textattribute Not supported Not supported
Field Identification XML element tag name / attribute name Positional order separated by FieldSeparator Positional character offset defined by Width
Field Quoting Not applicable (XML escaping rules apply) Controlled by FieldDelimiter Not applicable (spaces or zeros used for padding)
Typical Use Cases PEPPOL electronic invoicing, ISO 20022 bank payments, B2B XML integration Bank statement reconciliation, customer/vendor master data CSV imports, pricing feeds ACH / NACHA banking files, legacy payroll feeds, EDI flat files
Streaming Efficiency Moderate (tag overhead increases payload size) High (compact delimiter overhead) Highest (minimal payload overhead, fixed byte offsets)
Exam Watchout — Delimiters vs. Namespaces: Setting FieldSeparator or FieldDelimiter on an XMLport where Format = Xml has no effect. Conversely, defining XML attributes or namespaces on an XMLport where Format = VariableText or FixedText results in a compilation error or ignored runtime metadata.