1

I've got a custom Document Library created as a feature in SharePoint (WSS3). I've created and customized the library by modifying its schema.xml and other corresponding xml files.

The problem is that I need to enable the Document Version History. I can do this via the web GUI but not in xml definition. In the tag I've got the following attributes set:

EnableContentTypes="TRUE" BaseType="1" VersioningEnabled="TRUE" EnableMinorVersions="FALSE" MajorVersionLimit="5" ForceCheckout="TRUE"

When I create a library based on the template and open the Versioning Settings I can see that Require Check Out is true but Document Version History is still set to No Versioning. I need to set it to "Create major versions" and limit the amount to 5. As far as I know my markup should be correct but it doens't seem to work.

I would greatly appreciate any information on how to achieve this.

Thanks.

1 Answers1

2

You should enable versioning in the ListInstance, not the schema.xml.

Colin
  • 10,630
  • 28
  • 36
  • In which file the ListIntance tag should available? I have the Feature.xml, MyDocumentLibrary.xml and schema.xml and none of them contains the ListInstance tag. Don't know why it's missing since I made the library from a copy of the default Document Library. – sharepoint problems Jan 12 '11 at 15:00
  • It seems SharePoint gets different defaults depending on how I create the library from the said template. If I create it manually it will get wrong defaults and will disable the versioning (I guess configuring the ListInstance attributes could fix this). But if I create the library programmatically from the template it will actually enable the version history. – sharepoint problems Jan 13 '11 at 09:08