Showing posts with label Document Library. Show all posts
Showing posts with label Document Library. Show all posts

Tuesday, October 6, 2009

Elements.xml file for creating folders inside document library

Below is the sample elements.xml file content for creating folders inside document library through features


<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"><Module Path ="Client Supplies" Url ="Requirement/Client Supplies" />
<Module Path ="Functional Requirements" Url ="Requirement/Functional Requirements" />

</Elements>


Please note that, like this any level of nested folder structure can be created. (Url = "Docs/FirstLevel/SecondLevel/ThirdLevel"

Solution for "Cannot complete action. Try again later" error while activating ListInstance in sharepoint

Each ListInstance in ListInstance.xml file must contain "FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101"" to avoid this error. 
Basically, your <ListInstance> node should look like as shown below;


    <ListInstance
           Title="Requirement Management"
           Description="Requirement Management"
           Id="A26D9F72-5F3B-477d-8E43-CB20698BC669"
           TemplateType="101"
FeatureId="00bfea71-e717-4e80-aa17-d0c71b360101"
OnQuickLaunch="true"
           Url="Requirement">
    </ListInstance>



The feature ID listed above is the FeatureID of the a normal (OOTB) sharepoint feature. This is required to find the TemplateType 101; which is a default doclib.