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 :
Small and medium business | Business Central, N...
Suggested Answer

Change data type from integer to decimal

(3) ShareShare
ReportReport
Posted on by 144
Hi,
 
we use BC OnPrem and we have a special field in several tables (Sales Line + Sales Shipment Line + Sales Invoice Line) that currently has the Integer data type and is integrated into many pages, reports and codeunits. Now it is necessary that we also have to record decimal numbers here. 
 
To change the data type I would like
  1. Save the current values for this field in a separated table
  2. Change the data type of this field using ForceSync
  3. Write the separate saved values back into the tables.
Is it correct that with this procedure (via ForceSync) only the contents of this one field are deleted in the tables? And can I therefore safely do it as described above?
Or is there another danger lurking here? Since I've usually only worked with Synchronize so far, I'm a little unsure what effect this might have when using ForceSync.
 
kind regards
Ralf
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
    Hi @neckit,
    I don't think there is any deletion in this case since the change from integer to decimal type
    also you can use Synchroise mode
    Best regards,
    Mohamed Amine MAHMOUDI
  • neckit Profile Picture
    144 on at
    That is not correct. Synchronize is not accepted here and an initial test with ForceSync showed that the field values are then deleted. But I'm still unsure what further consequences this could have and whether my approach is advisable!
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at
    if your are not sure you can test in sandbox environment.
    BR
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Ram Pranav Profile Picture
    50 on at
    Ralf,
     
    The best practice is to
    1. Obsolete the Integer field.
    2. Create a new Decimal field.
    3. Replace all the references of the old field with the new field. (You can do this in VsCode by Right Click -> Go to References)
    4. Create an Upgrade Codeunit.
    5. In the upgrade CU, use the DataTransfer datatype to transfer the value from Integer field to Decimal field.
    6. Test your functionalities, check if the values are transferred properly to the new field.
    7. Once tested thoroughly, remove the old integer field by force syncing the extension.
  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at
    Hi, hope the following can give you some hints.
    In-depth testing for Force Sync mode in Production Environment (Renaming tables, Renaming fields, Changing field type…)
     
     
    Thanks.
    ZHU

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

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans