Guide to Handling Header and Detail Imports into Business Central with AL
This guide demonstrates how to parse and import delimited files containing header and detail records (like sales orders) into Business Central using AL. It covers two formats: normalized (separate header/detail lines identified by markers) and denormalized (merged header/detail data on single lines), with code examples for parsing both formats into staging tables and creating sales orders.

post Aardvark Labs
"When dealing with a denormalized structure we must have something to anchor us. In this case the External Document Number will be our identifier."
Key points
- Normalized format uses marker characters (H/D) to distinguish header and detail lines, while denormalized format repeats header fields on each detail line
- Data is parsed into separate staging tables (ARD_SalesHeader and ARD_SalesDetail) before creating actual sales orders
- Denormalized parsing relies on detecting changes in an anchor field (external document number) to create new headers
- The parsing logic handles line-by-line text processing, field extraction via delimiters, and linking details to headers via ID tracking
Quotes
- “When dealing with a denormalized structure we must have something to anchor us. In this case the External Document Number will be our identifier.” (Explains the key technique for detecting new headers in merged-format files without explicit markers)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- table “ARD_SalesHeader”
- table “ARD_SalesDetail”
- page “ARDSalesImport”
- page “SalesImportCard”
- page “SalesImportDetails”
Not found in BC28-30: table “ARD_SalesHeader”, table “ARD_SalesDetail”, page “ARDSalesImport”, page “SalesImportCard”, page “SalesImportDetails”.
Context
- Features: delimited file import, text parsing, staging tables, sales order creation, normalized import, denormalized import
Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.