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 created a custom Document Library in VS 2010, I've added a content type with some custom fields based on the document content type.

Which parameters do I need to use in my elements.xml/schema.xml to enable following options on my custom doc lib:

  • Require Check Out = TRUE
  • Create Major Versions (Enabled)
share|improve this question
    
Found my answer for the create Major versions you should enable versioning in the ListInstance (VersioningEnabled="TRUE"), not the schema.xml. Still looking how to forcecheckout? –  Wim Hill Apr 18 '11 at 7:47
add comment

1 Answer 1

up vote 2 down vote accepted

http://msdn.microsoft.com/en-us/library/ms415091.aspx

http://msdn.microsoft.com/en-us/library/aa543874.aspx

This might do what you need for the versioning:

  • ForceCheckout = TRUE
  • VersioningEnabled = TRUE
  • EnableMinorVersions = FALSE

Some properties can only be set via code, and then you have to make a SPListEventReceiver and override ListAdded

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisteventreceiver.listadded.aspx

But for these you should be okay

share|improve this answer
    
Thanks for the answer Djeeg! In my listInstance I'm not allowed to add the attribute ForeCheckout (attribute not decalred) Is this than a case were I should set them through code after the list was added? –  Wim Hill Apr 18 '11 at 8:15
    
Djeeg your sollution of doing this through an event receiver works fine but not completly as expected. My ForeCheckout is only applied when new document libraries are added and not with my initial list instance deployment through my feature. –  Wim Hill Apr 18 '11 at 8:44
    
is the feature activation order: definition, event receiver, then instance? –  djeeg Apr 18 '11 at 8:58
    
or you could try using the CustomSchema attribute, what components do you have atm? ListInstance? List? –  djeeg Apr 18 '11 at 9:03
    
Got it working with the event receiver but with some overkill. I added a second feature with only the event receiver. And made my feature activating the list def and list instance depending on it. (When I tried to put them all in one feature with your sugested order it dindn't work) Interested in the CustomSchema attribute... For the moment I have an elements file and schema file for my definition and an elements file for my list instance (generated when taking New item, List definition, type Document Library in VS2010) –  Wim Hill Apr 18 '11 at 9:16
show 1 more 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.