Create Project in Project Online using CSOM:-

In this post, I will explain you Programmatically Create Project in Project Online using CSOM. Before to create the project in project online using CSOM, you must use the Microsoft.ProjectServer.Client namespace instead of the PSI. How to add namespaces and dll reference in csom, I already told you in my previous post. I also explain to you how to create project using psi

YouTube Link, Please like and subscribe my channel

[AdSense-A]

Comments

  1. Thanks for your code, The same way I need to read all employee timesheets of Project Online using CSOM?.

    Please suggest me the best approach, where I can read all timesheets from Project Online based on resource type and need to export to csv ?

  2. We have a required custom field. Trying:
    pci = new ProjectCreationInformation();
    pci.Id = Guid.NewGuid();
    pci.EnterpriseProjectTypeId = _eptid;
    pci.Name = projectname;
    pci.Description = xxx; //non-relevant function for this question
    pci.Start = DateTime.Now;

    PublishedProject pub = _prj.ProjectContext.Projects.Add(pci);
    pub.Owner = xxx; //(non-relevant code here)
    //adding our custom field here
    pub.SetCustomFieldValue(internalname,parray); //parray because it’s a lookup table
    QueueJob qj = _prj.ProjectContext.Projects.Update();
    JobState jb = _prj.ProjectContext.WaitForQueue(qj, 300);
    The jb line always fails with “Value cannot be null.
    Parameter name: row”

    what are we doing wrong?

Leave a Reply

Your email address will not be published. Required fields are marked *