CRM Custom Attributes

‘Wrong value type is passed to the control…’ for CRM 3.0 Custom Attribute
Microsoft Dynamics CRM 3.0 is one of those applications that is amazing in its flexibility and power but can be frustrating when you are challenged by unexpected issues. Whilst working on some custom attributes for a  CRM form today I started to get error being raised when I was saving information to one of these custom attributes. After a little surfing I found that other people had come accross this problem and it seems to stem from reusing a schema name for custom attributes.
For example;
  • 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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s