Dynamic Business central 365: Understanding AutoUpdate and AutoReplace Properties in XMLports
When importing data into Microsoft Dynamics 365 Business Central using XMLports, developers often focus on field mapping and file formats. However, import behavior is largely controlled by XMLport properties, and misunderstanding them can easily lead to data loss or incorrect updates.
Two such critical properties are AutoUpdate and AutoReplace.
Although they sound similar, they behave very differently and must be used carefully.
This blog explains what each property does, how they differ, and when to use them.
Why AutoUpdate and AutoReplace Matter
During an XMLport import, Business Central checks whether a record already exists in the database using the primary key.
If a matching record exists, Business Central must decide:
-
Should the record be updated?
-
Should it be replaced entirely?
-
What happens to fields not included in the import file?
That decision is governed by AutoUpdate and AutoReplace.
AutoUpdate Property
AutoUpdate specifies whether an existing database record with the same primary key should be updated using values from the import file.
Key behavior:
-
Only fields present in the import file are updated
-
Fields not present in the file remain unchanged
-
Existing data is preserved
In simple terms:
AutoUpdate updates only what the file contains and leaves the rest untouched.
Example
Existing Item Record
| Field | Value |
|---|---|
| No. | ITEM001 |
| Description | Laptop |
| Unit Cost | 500 |
| Blocked | No |
Import File Contains:
No,Unit Cost
ITEM001,550
After Import with AutoUpdate = true
| Field | Value |
|---|---|
| No. | ITEM001 |
| Description | Laptop (unchanged) |
| Unit Cost | 550 (updated) |
| Blocked | No (unchanged) |
When to Use AutoUpdate
-
Partial data updates
-
Master data maintenance
-
Safe imports where existing data must not be lost
-
Incremental updates from external systems
AutoUpdate is generally the safer and recommended option for most imports.
AutoReplace Property
AutoReplace specifies whether an existing database record should be completely replaced by the imported record.
Key behavior:
-
Fields present in the file are updated
-
Fields not present in the file are reset to their InitValue
-
Existing values are overwritten or cleared
In simple terms:
AutoReplace treats the import file as the complete definition of the record.
Example
Existing Item Record
| Field | Value |
|---|---|
| No. | ITEM001 |
| Description | Laptop |
| Unit Cost | 500 |
| Blocked | Yes |
Import File Contains
This was originally posted here.

Like
Report
*This post is locked for comments