contenttype - SharePoint 2010: RemoveFieldRef and Inherits="TRUE" -


i have created custom content type inherits ootb sharepoint picture content type. customisations have made add simple url field, , remove 2 of fields on base type. see below:

<elements xmlns="http://schemas.microsoft.com/sharepoint/">     <!-- parent contenttype: picture (0x010102) -->     <contenttype id="0x0101020027f16ab27e6e45a6848c25c47aaa7053"                  name="custom picture"                  description=""                  group="custom"                  inherits="true"                  version="0">         <fieldrefs>             <removefieldref id="{b66e9b50-a28e-469b-b1a0-af0e45486874}" name="keywords" />             <removefieldref id="{a5d2f824-bc53-422e-87fd-765939d863a5}"  name="imagecreatedate" />             <fieldref id="{c29e077d-f466-4d8e-8bbe-72b66c5f205c}" name="url" displayname="url" required="false" />         </fieldrefs>     </contenttype> </elements> 

if create picture library based on custom content type, "url" field added appears in new/edit forms, 2 fields have attempted remove displayed, i.e. the removefieldref's being ignored. if @ content type in "site settings -> content type gallery", these 2 fields still listed there.

setting inherits="false" on custom content type (see msdn definition) removes just these two fields "site settings -> content type gallery" page, none of base fields displayed in new/edit forms -- custom "url" field.

what can ensure fields base "picture" content type displayed on new/edit forms of picture library except 2 fields have removed?

i believe nature of issue understanding of how content type inheritance works.

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

if inherits true, child content type inherits fields in parent, >including fields users have added.

if inherits false or absent , parent content type built-in type, child >content type inherits fields in parent content type when >sharepoint foundation installed. child content type not have fields >users have added parent content type.

if inherits false or absent , parent content type provisioned sandboxed >solution, child not inherit fields parent.

i think key phrase above "if inherits true, child content type inherits fields in parent including fields users have added."

this means in order accomplish set out have not not have inherits set true , have include fieldref elements fields wish use in content type.

you make no reference / don't include code how content type added list instance. make sure has been updated support removal or setting of inherits false.

these sites support described here.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -