Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to change a field type in existing table ?

(0) ShareShare
ReportReport
Posted on by 592

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,

  • Voltes Profile Picture
    Voltes 592 on at
    RE: How to change a field type in existing table ?

    Noted.

    Thank you both.

  • Verified answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,587 Super User 2024 Season 1 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
    Martin Dráb 230,962 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans