The attribute type doesn't seem to matter, the same occurs for both a Nullable int and a Nullable datetime in my case. Since that's their type, I would assume setting them to null should work, but it doesn't. In the property in the generated class, you see
this:
[Microsoft.Xrm.Sdk.AttributeLogicalNameAttribute("new_certainattribute")]
public System.Nullable<int> new_certainattribute
{
get
{
return this.GetAttributeValue<System.Nullable<int>>("new_certainattribute");
}
set
{
this.SetAttributeValue<System.Nullable<int>>("new_Certainattribute", "new_certainattribute", value);
}
}
The only thing I can think of at the moment is that it's not working because I'm not retrieving the record from CRM first. I just create a new instance of the entity and then update only the attributes that need to be changed and set the id. This always
seemed to work since it did update the values, but perhaps it fails in this scenario. The documentation below does mention that you need retrieve the record, so I'm guessing that might be the cause of the problem:
http://msdn.microsoft.com/en-us/library/gg328499.aspx