I'm working on a custom contenttype of the type Documentset. I want to set the alllowed contenttypes, but this is not working, it's only showing the defeult document. I read several blogs but i can't find my solution.

<?xml version="1.0" encoding="utf-8"?> 
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> 
  <!-- Parent ContentType: Document Set (0x0120D520) --> 
  <ContentType ID="0x0120D520008d2ff418027e4c31b54d155b98596748" 
               Name="Custom Dossier" 
               Group="Custom group" 
               Description="Custom dossier" 
            <FieldRef ID="{8D6C094C-3E1F-41f4-BEE3-25B27EE09702}" Name="Dossier_Nummer" DisplayName="Dossiernummer" Required="True"  /> 
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes"> 
        <act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="05/31/2012 08:46:56"> 
          <AllowedContentType id="0x0101" /> 
          <AllowedContentType id="0x0101000490d50c50624b6ca21c637ef39cd89b" /> 

Please try and set the Inherits attribute on the content type to FALSE. There is a bug in the feature framework that causes any declaration to be silently ignored if the inherit attribute is set to true (wiich in turn, by Murphy law, is true by default). I suspect that this should be your case (I don't think that any CU/SP fixed the bug as today).

Just remember to compensate for the Inherits="False" attribute... and lit a candle to the SharePoint dev deity if you didn't have 8 children content types to update also...

  • Publishing a custom documentset with inherits on false, will not work. Publishing is not possible with subtypes? – Active_t Jun 4 '12 at 15:11
  • Sorry to answer so late. I'm not sure of what you mean... Can you elaborate a little more? You mean that the content type in your example above is not working as intended?? Or you have defined a second content type that derives from the original one? – SPArcheon Jun 5 '12 at 15:06
  • This is still an issue(feature?) in SP 2013 with SP1 and Inherits="FALSE" fixes it. Thanks! – Richard Jun 6 '14 at 18:11
  • Thanks for the info, @Richard. I will try to double check as soon as I get the occasion. – SPArcheon Jun 9 '14 at 9:03

I have a work-around where you can create your Doc Set content type, set Inherits="True", and still keep all your custom XMLDocuments. Basically the idea is to use a feature receiver on the feature where you deploy your ctype definitions, pull out the elements.xml files, and copy your XMLDocuments into the ctype defs on the site (which have ignored your changes because Inherits="True"). I have some example code on my blog:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.