Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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" 
               Overwrite="True" 
               Name="Custom Dossier" 
               Group="Custom group" 
               Description="Custom dossier" 
               Inherits="True" 
               Version="0"> 
    <FieldRefs> 
            <FieldRef ID="{8D6C094C-3E1F-41f4-BEE3-25B27EE09702}" Name="Dossier_Nummer" DisplayName="Dossiernummer" Required="True"  /> 
    </FieldRefs> 
    <XmlDocuments> 
      <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" /> 
        </act:AllowedContentTypes> 
      </XmlDocument> 
    </XmlDocuments> 
  </ContentType> 
</Elements> 
share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

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...

share|improve this answer
    
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? –  SPArchaeologist 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 at 18:11
    
Thanks for the info, @Richard. I will try to double check as soon as I get the occasion. –  SPArchaeologist Jun 9 at 9:03
add comment

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:

http://morefunthanapokeintheeye.blogspot.com/2012/10/how-to-successfully-publish-custom.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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