BC Friday Tips #21 Understanding 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.
