Provision Document Set + XMLDocuments and ???

SharePoint development is fraught with frustrations. Little things that should be simple, end up taking far longer than they should. Take this example. I’m trying to provision a Document Set content type via XML in a VS feature. I was using this video and the supporting article as a guide. I get all the way through, and everything is working… ish. That is, the Document Set content type is created, but the extra stuff to do with it, such as the custom welcome page and the extra properties (shared fields, etc.), defined in the XmlDocuments section of the content type, don’t appear. No manner of tweaking and reducing code had any effect. I got a hold of the source code from the tutorial – lo and behold, that works fine. So the theory is sound, it should work, and so something somewhere was different. The job was tracking down said difference.

After a day and half, I was exasperated and set to give up. I’d found lots of people out on the internet, either with working solutions or with the same or very similar problem, but no solution. One final round of Google-bashing and found an innocent little post on MSDN. Near the bottom is the solution.

It is a bug that was reported elsewhere in this forum. The bug is triggered when you set Inherits=”TRUE” in the content type definition; it will then ignore any tag you put in. Presumably, it will simply inherit the parent’s XmlDocuments, rather than appending them to the ones you provide.

The good news, then, is that you can “fix” the problem by setting Inherits=”FALSE”. The bad news is that you then have to put in manually everything that should be inherited.

That’s right, if your Document Set content type is set to inherit, then all your customisations are ignored. Unbelievable. So there you have it.

Tags: , , , , , , ,

3 Responses to “Provision Document Set + XMLDocuments and ???”

  1. [...] finished, package it all up and deploy. Simple, right? Well, no, not necessarily – as I mentioned recently, this process is not without its bugs and [...]

  2. [...] can then deploy your feature, and assuming you’ve covered all the bases your Document Sets, with custom Welcome Page should be deployed. But here’s a problem. [...]

Leave a Reply