I recently had to upgrade SharePoint 2007 code to Visual Studio 2010.
The code contained a content type definition with a RemoveFieldRef tag which allows us to removed a field from a parent content type; typically we remove the Title column…
It worked perfectly in SharePoint 2007, but in SharePoint 2010, my Title column was still there.
Then I noticed when I create a new Content Type SharePoint project item, Visual Studio 2010 add a new SharePoint 2010 attribute : Inherits with a value set to…TRUE;
According to the sdk:
<<Optional Boolean. The value of this attribute determines whether the content type inherits fields from its parent content type when it is created.
If Inherits is TRUE, the child content type inherits all fields that are in the parent, including fields that users have added.
If Inherits is FALSE or absent and the parent content type is a built-in type, the child content type inherits only the fields that were in the parent content type when SharePoint Foundation was installed. The child content type does not have any fields that users have added to the parent content type.
If Inherits is FALSE or absent and the parent content type was provisioned by a sandboxed solution, the child does not inherit any fields from the parent.>>
I noticed that Inherits has also an impact on RemoveFieldRef :
Setting this attribute to FALSE did the work and my RemoveFieldRef option worked :
Then I decided to try the same option on a custom publishing content type, but setting Inherits to FALSE made my publishing…unavailable (and no errors during deployment, I just don’t see it, even by using SharePoint Manager 2010)
Don’t set Inherits to FALSE in custom publishing content types.