BC Friday Tips #21 Understanding AppVersion and DataVersion

AppVersion and DataVersion

It’s BC Friday Tips time for Business Central developers.

๐Ÿ’ก AppVersion vs DataVersion โ€“ Do You Know the Difference?

When working with extensions in Business Central, understanding AppVersion and DataVersion is important.

Key Behaviors:

๐Ÿ”น Fresh Install โ†’ AppVersion = New, DataVersion = 0.0.0.0

๐Ÿ”น Upgrade โ†’ AppVersion = New, DataVersion = Previous version

๐Ÿ”น Reinstall โ†’ Both versions the same version 

Why does this matter?

โœ… Ensures proper installation & upgrade handling

โœ… Helps determine when to trigger data migration

For example, only migrate data when upgrading from version 2 or earlier:

procedure PerformDataMigrationWhenComingFromV2(CurrModuleInfo: ModuleInfo)

begin

ย ย //Only do data migration when upgrading from version 2 and below

ย ย if CurrModuleInfo.DataVersion.Major > 2 then

ย ย ย ย exit;

ย ย //Run Upgrade process

end;

For more detail, check out this blog post.

thatnavguy

Experienced NZ-based NAV Developer and Consultant with 15+ years of experience leading multiple IT projects, performing business analyst, developing, implementing, and upgrading Dynamics NAV and Business Central. Passionate to deliver solution that focuses on user-friendly interface while keeping high standard of compliance with the needs.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *