web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Dynamic Business central 365: Understanding AutoUpdate and AutoReplace Properties in XMLports

Khushbu Rajvi. Profile Picture Khushbu Rajvi. 20,977 Super User 2025 Season 2

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

FieldValue
No.            ITEM001
Description          Laptop
Unit Cost          500
Blocked          No

 Import File Contains:

No,Unit Cost

ITEM001,550

After Import with AutoUpdate = true

FieldValue
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

FieldValue
No.    ITEM001
Description    Laptop
Unit Cost    500
Blocked    Yes

 Import File Contains

No,Unit Cost ITEM001,550

After Import with AutoReplace = true

FieldValue
No.            ITEM001
Description''          (reset)
Unit Cost            550
Blocked            No (reset to InitValue)

When AutoReplace is enabled:

  • Business Central resets all unspecified fields
  • The InitValue property defines what the reset value will be

This can unintentionally remove critical data if not used carefully.

When to Use AutoReplace

  • Full master data reloads
  • Controlled data migrations
  • Initial system setup
  • Scenarios where the file truly represents the complete record

AutoReplace should be used only when you are certain the import file contains all required fields.

Best Practices

  • Prefer AutoUpdate for routine imports
  • Use AutoReplace only for controlled scenarios
  • Always test imports in a sandbox environment
  • Clearly document which properties are enabled
  • Combine with proper validations and backups

Although AutoUpdate and AutoReplace appear similar, they serve very different purposes.

AutoUpdate protects existing data.
AutoReplace resets it.


Thanks For Reading...!!

Regards,
Khushbu Rajvi


This was originally posted here.

Comments

*This post is locked for comments