For creating list item, we have to use ListItemCreationInformation
First we create list of Risks
using Microsoft.SharePoint.Client;
context = new ClientContext(projectSiteUrl); //pass your project site url
context.Credentials = projectContext.Credentials;
List spList = context.Web.Lists.GetByTitle("Risks");
ListItem newListItem = spList.AddItem(itemCreateInfo);
newListItem["Title"] = "Test 1";
newListItem["Status"] = "Active";
newListItem["Category"] = "Resource";
newListItem["DueDate"] = DateTime.ParseExact("2016-05-01", "yyyy-MM-dd HH:mm tt", null);
newListItem["Probability"] = "0.1";
newListItem["Impact"] = "1";
newListItem["Cost"] = "10000";
newListItem["Description"] = "Test description";
newListItem["Mitigation_x005F_x0020_plan"] = "";
newListItem["Contingency_x005F_x0020_plan"] = "";
newListItem["Trigger_x005F_x0020_Description"] = "";
newListItem["Trigger"] = "Date";
newListItem["Order"] = "10";
newListItem["FileLeafRef"] = "2_.000";
newListItem["MetaInfo"] = "";
newListItem.Update();
context.ExecuteQuery();
In the same way, we have to create list of Issues and Deliverables.
Issues:
using Microsoft.SharePoint.Client;
context = new ClientContext(projectSiteUrl); //pass your project site url
context.Credentials = projectContext.Credentials;
List spList = context.Web.Lists.GetByTitle("Issues");
ListItem newListItem = spList.AddItem(itemCreateInfo);
newListItem["Title"] = "Test 1";
newListItem["Status"] = "Active";
newListItem["Category"] = "Resource";
newListItem["Priority"] ="High";
newListItem["DueDate"] = DateTime.ParseExact("2016-05-01", "yyyy-MM-dd HH:mm tt", null);
newListItem["Discussion"] = "Test discussion";
newListItem["Resolution"] = "";
newListItem["Order"] = "10";
newListItem["FileLeafRef"] = "2_.000";
newListItem["MetaInfo"] = "";
newListItem.Update();
context.ExecuteQuery();
Deliverables:
using Microsoft.SharePoint.Client;
context = new ClientContext(projectSiteUrl); //pass your project site url
context.Credentials = projectContext.Credentials;
List spList = context.Web.Lists.GetByTitle("Deliverables");
ListItem newListItem = spList.AddItem(itemCreateInfo);
newListItem["Title"] = "Test 1";
newListItem["Order"] = "10";
newListItem["FileLeafRef"] = "2_.000";
newListItem["MetaInfo"] = "";
newListItem["CommitmentStart"] = DateTime.ParseExact("2016-01-01", "yyyy-MM-dd HH:mm tt", null);
newListItem["CommitmentFinish"] = DateTime.ParseExact("2016-05-01", "yyyy-MM-dd HH:mm tt", null);
newListItem["SuppressCreateEvent"] = "False";
newListItem.Update();
context.ExecuteQuery();
0 Comment(s)