Question

I am creating a document set content type and I want a custom field to appear in the welcome page. Strange this is that it appears on the new form, but not in the welcome page As you can see in the code below, the id are the same

 <ContentType ID="0x0120D520009B92940A0AEA485ABBD36F6C18024964"
               Name="$Resources:xxx,content_types_bill_name;"
               Group="$Resources:xxx,contenttypes_clientManagement_group;"
               Description="$Resources:xxx,content_types_bill_description;"
               ProgId="SharePoint.DocumentSet"
               Inherits="TRUE"
               Version="0">
    <Folder TargetName="_cts/Bill" />
    <FieldRefs>
      <FieldRef ID="{3814501B-C276-4B03-9695-1C80B5661BC9}"
                Name="xxx_ClientCode"
                Required="FALSE" />
    </FieldRefs>


    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/welcomepagefields">
        <wpf:WelcomePageFields xmlns:wpf="http://schemas.microsoft.com/office/documentsets/welcomepagefields" LastModified="05/12/2012 13:23:22">
          <WelcomePageField id="3814501B-C276-4B03-9695-1C80B5661BC9" />
        </wpf:WelcomePageFields>
      </XmlDocument>
    </XmlDocuments>
  </ContentType>
Was it helpful?

Solution

The problem is that you have set Inherits="TRUE". When you do that, and deploy/install your content type, SharePoint will conveniently ignore anything in the XMLDocuments section of your content type definition. Not a big deal for a lot of content types that don't necessarily need anything in the XMLDocuments section, but a big problem for Document Sets, which rely heavily on the XMLDocuments.

I ran into this problem myself, and have developed a workaround where you can re-inject your custom XMLDocuments into the content type definitions after they have been deployed to a site, using a feature receiver. Example code can be found on my blog.

Incidentally, I really needed to be able to set Inherits="TRUE" in order to publish my content types through a Content Type Hub. If you don't need to do this, you can have your content type preserve all of it's customization by setting Inherits="FALSE". If you do that, however, you will need to remember to explicitly include everything that you would be inheriting from the base Document Set content type (all the default FieldRefs, the Document Set event receivers, etc.)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top