2

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)
1
  • 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
    Commented Apr 18, 2011 at 7:47

1 Answer 1

2

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

6
  • 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
    Commented Apr 18, 2011 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
    Commented Apr 18, 2011 at 8:44
  • is the feature activation order: definition, event receiver, then instance?
    – djeeg
    Commented Apr 18, 2011 at 8:58
  • or you could try using the CustomSchema attribute, what components do you have atm? ListInstance? List?
    – djeeg
    Commented Apr 18, 2011 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
    Commented Apr 18, 2011 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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