Best Microsoft Dynamics CRM 2011 Solution to Change Object Field Data Type
I am having a problem changing the data type in a Dynamics CRM 2011 On Premise field. In my managed solution name it "Solution 1", I have a custom field in the contact object: "new_usernumber" type number (int). I want to change it to a string as per the requirements of the new client (for new users, they want to add a prefix to it). I can remove the solution and deploy a new "fixed" managed solution, but for that I need to remove the value in my custom fields. Is there a better solution for this?
TIA
source to share
There is no easy way to do this. If you do not already have the data deployed to the instance using a managed solution, I recommend deleting it and importing the patched managed solution file.
There is no supported or unsupported process for changing the data type (or logical name) of a field without losing data. You will need to add a new field and then write a quick update utility to copy the data from the old field to the new field.
Here's a great article on how to remove a deleted field in a managed solution. Please note: if you are trying to save data, you will need to run the update after the step "Import devkeydetDeleteExample_1_1_HOLDING.zip"
Have fun ... it's a pain, but definitely doable!
source to share
Several months ago, I recreated the fields in a solution (double to int). It was a huge mistake . I'm still not sure where it went wrong, but they did . Not only did I lose my date. I managed to introduce errors in the meta layer so our MVP had to sit, help me get it working again. He was displeased. I was unhappy. The client was dissatisfied (a former client today, mostly because of this).
So, my humble advice is don't do it. Declare a new field instead. If you have a number, keep it, but start using userNumberString (or userString, userName, etc.). I assume that you will keep your hair longer.
And if you succeed, tell me. :)
source to share