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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to change a field type in existing table ?

(0) ShareShare
ReportReport
Posted on by 596

Hi guys,

I'm asking this in relation with development then later for the deployment (maybe to UAT or Production), since I'm experiencing difficulties to change my field from a String to Enum type. Which apparently I need to delete first the field which mean I also need to change (remove) all the reference as and when it is used in code classes or in forms then Build & Synchronized successfully.

Do I need to Check-in first this deletion ? then also wait for the next deployment succeeded, before then I can add new field with the "wanted" field type which is in my case is Enum ?

Or I can, after the Build & Synchronize after the deletion, then Check in, then I can just add the new field, Build & synchronized again, and Check-in again ? 

So when doing deployment, it will know there is two steps : deletion and add new field but with the same name ?

Thanks,

I have the same question (0)
  • Voltes Profile Picture
    596 on at
    RE: How to change a field type in existing table ?

    Noted.

    Thank you both.

  • Verified answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    RE: How to change a field type in existing table ?

    I would suggest you to first delete the string field and all related code and do a build sync. On successful build you can checkin that to UAT.  Then add the new enum field and again do build sync and check-in.

    But never try to rename and change the base enum as it is not possible because it is a string field and system won't allow you to do so.

    So on delete the field and checking in will lead to drop the field from uat also and again adding should solve the problem.

  • Verified answer
    Martin Dráb Profile Picture
    236,279 Most Valuable Professional on at
    RE: How to change a field type in existing table ?

    In general, I recommend creating a new field rather then changing the type of the same field. It's much safer.

    Also, if you want to directly migrate data from the existing (string) field, you'll need both fields existing at the some time, therefore deleting the old field before creating the new one isn't an option.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,206

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 847 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 596 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans