How to Migrate Business Central Table Fields from Integer to BigInteger.
Business Central version 29 enables developers to migrate table fields from Integer to BigInteger without data loss during upgrades when targeting runtime 18.0 or later. This addresses scenarios where record identifiers exceed the 32-bit integer limit, while requiring careful handling of dependent code that may face narrowing conversions.
Read it hereOpen in Claudetag-blogger-com-1999-blog-3122193036149030463-post-3697577773817687094--e070102696.md
.png)
post Saurav Dhyani
"Every valid Integer value is also a valid BigInteger value. The conversion is widening, not narrowing, so existing data is preserved."
Key points
- In version 29, with runtime 18.0 or later, an existing Integer table field can be changed to BigInteger without losing data. Schema sync converts the SQL column from int to bigint.
- The migration only works one way. Changing BigInteger back to Integer is not supported because it narrows the value and can lose data.
- The compiler warns when a BigInteger field is narrowed to Integer, Option or Enum in property contexts such as TableRelation or CalcFormula WHERE clauses.
- AppSourceCop rule AS0141 flags how the field type change may affect dependent extensions, so those extensions should be tested before publishing.
- Recommended steps: widen dependent variables and return types, check CalcFormula target types, and test with values above 2,147,483,647.
Quotes
- “Every valid Integer value is also a valid BigInteger value. The conversion is widening, not narrowing, so existing data is preserved.” (This clarifies the technical foundation that makes the feature safe and non-destructive compared to other field type changes.)
- “A BigInteger value assigned to an Integer can overflow silently or throw a runtime error. Treat every warning as a potential bug.” (This emphasizes the critical importance of addressing compiler warnings to prevent runtime failures in dependent code.)
Context
- Features: Integer to BigInteger field migration, AppSourceCop rule AS0141, Schema synchronization, CalcFormula evaluation, Narrowing conversion warnings, Property context validation
- Versions: version 29, runtime 18.0, Fall 2026
Source: Saurav Dhyani, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.