- create a custom attribute with a schema name of new_fieldname and assign it a field type of nvarchar.
- add the new attribute to a form and publish the form.
- remove the field from the form and then delete the attribute from the list of attributes.
- create a second custom attribute with the same schema name but assign it a different field type e.g. float.
- add the custom attribute back onto the same form and publish the form.
- When you try to save data to the form you get the ‘Wrong value type is passed to the control…’ error.
The solution, or the one that I have found to work for me, is to make sure that after you delete the original custom attribute from the form you publish the form before you create the second attribute with the same name but different type. This allows CRM to completely remove any references to the original custom attribute.