This project is read-only.
1

Resolved

Content type with "Inherits=false" declaration inherits parent CT fields

description

[SPGENContentType(
    ID = "0x0100CE2E5959AA85468F8BE838B190E90AF2",
    Name = "My Content Type",
    Group = "My group",
    Inherits=false)] // does not work (inherits Title field from OOB content type Item)
 
My current workaround for this:
 
protected override bool OnProvisionBeforeFinalization(SPContentType contentType, bool isParentList)
        {
            contentType.FieldLinks.Delete(SPBuiltInFieldId.Title);
            return base.OnProvisionBeforeFinalization(contentType, isParentList);
        }

comments

tore7506 wrote Mar 28, 2011 at 11:30 PM

The Inherits property have the same meaning as the Inherits attribute in the content type XML definition schema. The definition of the Inherit attribute from the msdn documentation is:

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.

http://msdn.microsoft.com/en-us/library/aa544268.aspx

The Title field should be inherited because it is inherited from the OOB Item content type, if the Inherits attribute is to be interpreted as the msdn documentation is stating.

Do you agree?

robertovich wrote Mar 29, 2011 at 8:44 AM

yea, sorry

tore7506 wrote Mar 30, 2011 at 9:54 AM

Inherits attribute will not longer be available from version 1.0.3 since it only works for features and XML-definitions. It doesn't seem to be supported in SP OM.

wrote Feb 14, 2013 at 3:13 AM

wrote May 16, 2013 at 8:49 AM

wrote May 16, 2013 at 8:49 AM

wrote Jun 14, 2013 at 7:55 AM