web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Best approach when DB sync table schema change issue

(1) ShareShare
ReportReport
Posted on by 558
Hello everyone,
 
I have a table with a field having type Enum, and after using for several time in production, we have to change the type to string, and result Build error, because of this conversion
 
May I know the best way to solve the error ? the error suggest us to delete the object (table), but it already contain many rows, also several object like data entity, security keys, forms that using this table. Wouldn't it produce more error if I delete the table ?
 
Can I get advice how to resolve this ?
Thanks
Categories:
  • Jonas "Jones" Melgaard Profile Picture
    5,017 Most Valuable Professional on at

    There is no fix for the error other than to rethink how to change the type of the field. And when you are in PROD, your options are pretty limited.

    I'm used to creating a new field on the table, instead of changing the type; not removing the table. This approach leads to fewer issues but requires some effort in updating it in tables, etc. Once you have migrated the data using a job and are confident in the migration, you can remove the old field from PROD.

    Can you use this approach?
    Also, you mention security keys. Is this part of an ISV solution?

  • Anthony Blake Profile Picture
    3,273 Super User 2026 Season 2 on at
    Hi Ken
     
    I agree with Jonas, create a new field and migrate to it.
     
    Anthony
  • Suggested answer
    Sankar Ramalingam Profile Picture
    264 on at
    You can't change the Table field data type directly as in the DB, it has to recreate the field.
     
    Solution:
     
    1. As "Jonas" suggested, you can create a new field to store the value as string.
    2. If you want to have same field with data type change Enum > String
        2.1. Least worried of data in the field in Prod - You can delete the field from your table and deploy to PROD. And again add the field with String field and deploy the package to Prod. 
        2.2. Worried of data in the field in Prod - You can create a new field to store the value as string and write x++ job to copy data from Enum to string using "enum2str()". Deploy it to Prod and run the Job. Again, follow 2.1.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 347 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 197

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans