Creating SharePoint Custom List using a list using a Microsoft.SharePoint.Client.ClientContext object: Lists.Add method from existing Template does not Include Template Content (include content was checked for template)

The code below works assuming you have a list template setup called "GenTasksTemplate".
The problem is that even though the check box to include content was checked during the creation of the template, the task items in the new list do not get populated.  What am I missing?
using System;
using System.Linq;
using Microsoft.SharePoint.Client;
protected void createSPlist(object sender, EventArgs e)
ClientContext context = new ClientContext("https://sharepointServer/sites/devcollection/");
var web = context.Web;
ListTemplateCollection ltc = context.Site.GetCustomListTemplates(context.Web);
ListCollection siteListsColection = web.Lists;
context.Load(ltc);
context.ExecuteQuery();
ListCreationInformation listCreationInfo = new ListCreationInformation
Title = "New Task from Template",
Description = "Tasks created from custom template"
Microsoft.SharePoint.Client.ListTemplate listTemplate = ltc.First(listTemp => listTemp.Name == "GenTasksTemplate");
listCreationInfo.TemplateFeatureId = listTemplate.FeatureId;
listCreationInfo.TemplateType = listTemplate.ListTemplateTypeKind;
listCreationInfo.DocumentTemplateType = listTemplate.ListTemplateTypeKind;
//listCreationInfo.CustomSchemaXml =
siteListsColection.Add(listCreationInfo);
context.Load(siteListsColection);
context.ExecuteQuery();
http://www.net4geeks.com Who said I was a geek?

Yes. I can create a list with the template using the UI.  I can also create list programmatically using the Microsoft.SharePoint library within a Windows Forms Application.  If I do create a provider-hosted app referencing Microsoft.SharePoint,
it results in a 64bit / 32bit mismatch error.  I am running SharePoint 2013 on a 64 bit Windows 2012 Server.
The problem is that with a provider-hosted SharePoint App, I am limited to only using the Microsoft.SharePoint.Client library which is very limited.
http://www.net4geeks.com Who said I was a geek?

Similar Messages

Maybe you are looking for

  • Problem with NSMutableData

    Let's say I've got an NSMutableData that I create and use like this: data = [NSMutableData dataWithCapacity:( someNumberOfBytes )]; [data appendBytes:buffer1 length:x]; [data appendBytes:buffer2 length:y]; [data appendBytes:buffer3 length:z]; Where x

  • Error when import BI content 3.5.3

    Hi All I have error when import BI content 3.5.3 step at Tcode 'SAINT' (file SAPKIBIFIH.car) for mySAP ERP 2004 (ECC 5.0 IDES). The error occur in step 3/5 after enter SAINT:Passw request. System shown information "<b>Queue SAPKLTHQ10 has not yet bee

  • Avoid seeing & as a variable

    I am trying to do a select statement from within Visual Basic where my column data has an & stored in it. When I perform this statement it returns no rows because it expected a substitution for the &. Select * from table where column = 'Sanford & Son

  • Contributors : Technical Names ??

    Hi, Since 1-2 days, there is a minor bug with the contributors. Indeed, some people are referred to with their internal number (I think) instead of their names : Here is an example for the SAP xApps Forums Top 3 Points:  1. Jo Weilbach (102); 2. I801

  • Today's highlight color

    On my MacBook Pro when I hit "Today" (top left of ical screen) the corresponding date has no highlight color. Yes, I have the screen very bright, but I cannot find where to set the highlight color to highlight today's date. On my mini with cinema dis