Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How can I modify the data type of a field when data has already entered?

(0) ShareShare
ReportReport
Posted on by

Hey guys,

I have a table and nearly all fields are from data type decimal, but one is integer.

I would like to change that integer-field to decimal.

I did a test on my local machine and I could recognize, that all the data of my data get lost, when I changed the data type from integer to decimal and when I saved the changes (compiled with force).

How do you think I can change the data type without losing all my data?

Or would it make more sense to leave the data type with integer?

Could there be any calculation errors later because it is not of the data type decimal ?

  • Verified answer
    Gearoid Profile Picture
    on at
    RE: How can I modify the data type of a field when data has already entered?

    Hi,


    You use Dynamics NAV upgrade codeunits when you make changes to a table definition from the Development Environment. Upgrade codeunits migrate existing business data from the old table structure into the new table structure.

    For more information see the following links:
    docs.microsoft.com/.../upgrade-codeunits
    community.dynamics.com/.../day-to-day-nav-upgrade-codeunits
    forum.mibuso.com/.../how-to-use-upgrade-codeunits

    It is also possible to manage this via TSQL by taking a copy of the table before you make the table schema change and then replacing the missing values afterwards. This is fine for a test environment but we would recommend a upgrade codeunit for managing this process in a live enviornment.

    Hope that helps!

  • Verified answer
    Microsoft Dynamics 365 Business Central Profile Picture
    on at
    RE: How can I modify the data type of a field when data has already entered?

    Hi

    i believe this is not better solution to modify data type for  column Containing transaction also you should know the impact of this change this will impact on other tables.

    you can do below steps on your Local Machine :

    1- know the other tables will effected by this modifications

    2- take backup from them

    3- make your update

    4- after that reinsert your data again according to this change

    5- try to make new transaction that will take effect with new change

    please note all this modification should be tested well on test server to avoid any issue in production.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans