Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create Risks,Issues and Deliverables using CSOM in SharePoint

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 570
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: