Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

ListCreationInformation custom template not applied

$
0
0

I have a custom document library template that I created by saving existing document library as template without data. I am able to create new document libraries using this template from the web interface and every setting I have is reflected in the new library that is created from this template.

But when I try to do the same using Client object model using the following code, the list is created using default settings and columns. The settings I have in the template are not applied.

                Web site = clientContext.Web;
                ListCreationInformation listCreateInfo = new ListCreationInformation();

                listCreateInfo.Title = listTitle;
                listCreateInfo.TemplateType = 101;
                listCreateInfo.TemplateFeatureId = new Guid("00BFEA71-E717-4E80-AA17-D0C71B360101");
                // Adding a new list under the root web
                List newList = site.Lists.Add(listCreateInfo);

I have verified the values of TemplateType and TemplateFeatureId to be correct after iterating through the list templates in the site. The template I created is listed and has the same values. 

Any custom template I create gets the same featureId as mentioned in the code above. How can I achieve this using client object model?


Viewing all articles
Browse latest Browse all 11571

Trending Articles