Home > SharePoint 2010 > How to deploy Document Set using CAML in SharePoint2010 solution package

How to deploy Document Set using CAML in SharePoint2010 solution package

In my last post, I showed you how to use Document Set using SharePoint UI in the browser. In this post, I’d like to show you how to create the same Document Set using CAML and SharePoint solution package. You can download the complete solution here.

1. Create the Application Number site column using the SharePoint empty element item template in VS2010

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
	<Field Type="Text" DisplayName="ApplicationNumber" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="YBBEST" ID="{916bf3af-5ec1-4441-acd8-88ff62ab1b7e}" Name="ApplicationNumber" ></Field>
</Elements>

2. Create the Loan Application Form and Loan Contract Form content types.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x0101005dfbf820ce3c49f69c73a00e0e0e53f6"
               Name="Loan Contract Form"
               Group="YBBEST"
               Description="Loan Contract Form"
               Inherits="TRUE"
               Version="0">
	  <FieldRefs>
		  <FieldRef ID="916bf3af-5ec1-4441-acd8-88ff62ab1b7e" Name="ApplicationNumber" DisplayName="ApplicationNumber" />
	  </FieldRefs>
  </ContentType>

  <!-- Parent ContentType: Document (0x0101) -->
  <ContentType ID="0x010100f3016e3d03454b93bc4d6ab63941c0d2"
               Name="Loan Application Form"
               Group="YBBEST"
               Description="Loan Application Form"
               Inherits="TRUE"
               Version="0">
	  <FieldRefs>
		  <FieldRef ID="916bf3af-5ec1-4441-acd8-88ff62ab1b7e" Name="ApplicationNumber" DisplayName="ApplicationNumber" />
	  </FieldRefs>
  </ContentType>
</Elements>

3. Create the Loan Application Document Set.

4. Create the Document Set Welcome Page using the SharePoint Module item template.

Notes:

1.When creating document set content type , you need to set the  Inherits=”FALSE”  or remove the  Inherits=”TRUE” from the content type definition (default is  Inherits=”FALSE”) . This is the Document Set limitation in the current version of SharePoint2010. Because of this , you also need to manually  attach the event receiver and  Document Set welcome page to your custom Document Set Content Type.

2. Shared Fields are push down only:

3. Not available in SharePoint foundation (only SharePoint Server 2010).

4. You can’t have folders within document sets (you can place document sets in folders though). For a complete limitation and considerations , you can see the references for details.

References:

Document Set Limitations and Considerations in SharePoint 2010 1

Document Set Limitations and Considerations in SharePoint 2010 2

Document Sets planning (SharePoint Server 2010)

Import Document Sets Issue

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

http://channel9.msdn.com/Events/TechEd/NorthAmerica/2010/OSP305

DocumentSet Class

Advertisements
  1. Dylan Cristy
    November 1, 2012 at 11:05 am

    I have a work-around for the problem of needing to set Inherits=”False” and adding the event receivers and welcome page. You can set Inherits=”True”, get all the default stuff for Doc Set, and still keep your custom XML Documents. Please see my blog post here:

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

  1. August 1, 2012 at 6:30 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: