Expand Minimize

Define attribute 'Inherits' to FALSE in ContentType if RemoveFieldRef are used

A content type should not have attribute 'Inherits' set to 'TRUE' if elements of type 'RemoveFieldRef' are used. Set Inherits to 'FALSE' or hide the not used columns with Hidden=TRUE to remove fields from a content type.

CheckId SPC015211
TypeName DefineInheritsInContentTypeWithRemoveFiedRef
Severity CriticalWarning
Type ContentType

A ContentType should not set 'Inherits' to TRUE because childs of type 'RemoveFieldRef' is used to remove fields from the content type. See sample below:

<ContentType ID="0x0101"
      <RemoveFieldRef ID="{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}" Name="GUID" />

To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.

<!-- "SuppressMessage":{"rule":"SPC015211:DefineInheritsInContentTypeWithRemoveFiedRef","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of Rencore. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.