none
Creating Enterprise project type in CSOM RRS feed

  • Question

  • I want to create a new EPT (project server 2013) using C# CSOM library.

    Here is what I have done so far:


    List<ProjectDetailPageCreationInformation> pages = new List<ProjectDetailPageCreationInformation>();
    
    projContext.Load(projContext.ProjectDetailPages);
    projContext.ExecuteQuery();
    
    projContext.Load(projContext.EnterpriseProjectTypes);
    projContext.ExecuteQuery();
    
    pages.Add(new ProjectDetailPageCreationInformation() { Id = projContext.ProjectDetailPages[12].Id, IsCreate = false });
    
    CreateEPT("New EPT ", "test desc", "PROJECTSITE#0", pages);
    
    private static void CreateEPT(string strName, string strDescription, string strTemplateName, List<ProjectDetailPageCreationInformation> pages)
    {
        EnterpriseProjectTypeCreationInformation newProjType = new EnterpriseProjectTypeCreationInformation();
        newProjType.Description = strDescription;
        newProjType.Id = Guid.NewGuid();
        newProjType.IsDefault = false;
    
        newProjType.Name = strName;
        newProjType.ProjectDetailPages = pages;
    
        newProjType.ProjectPlanTemplateId = Guid.Empty;
        newProjType.WorkflowAssociationId = Guid.Empty;
        newProjType.WorkspaceTemplateName = strTemplateName;
        newProjType.Order = 1;
    
        projContext.EnterpriseProjectTypes.Add(newProjType);
        projContext.EnterpriseProjectTypes.Update();
    }

    I'm getting EnterpriseProjectTypeCreatePDPIsRequired error. Any idea how to resolve this? Or have you created EPT for office 365 project server using CSOM.


    Thanks, Saravanan PRS

    Tuesday, December 30, 2014 7:12 PM

Answers


  • its code issue. we just need to set IsCreate=true . that did the trick. Thanks to my boss Neall :)

    Thanks, Saravanan PRS

    Wednesday, December 31, 2014 4:52 PM