Creating a Project with required custom field using CSOM : CustomFieldRequiredValueNotProvided RRS feed

  • Question

  • I can successfully create a Project using CSOM if the project doesn't have any required custom fields. 

    The moment i change one of the custom fields as required, i get the error

    PJClientCallableException: CustomFieldRequiredValueNotProvided

    I know how to update custom field values, and the values do get updated as long as custom fields are not required. 

    Has any one been able to create a project with required custom fields using CSOM / JSOM or REST yet? 

    Hammad Arif EPM Advice Blog

    Monday, June 1, 2015 7:26 AM

All replies

  • Has anyone created a project using CSOM with required custom fields ?

    Hammad Arif EPM Advice Blog

    Thursday, June 4, 2015 2:40 AM
  • Hi Hammad,
    I'm getting the same problem!

    Did you manage to find a solution?

    Thank you

    Wednesday, June 24, 2015 9:22 AM
  • Hi Agostino,

    In my later tests, i realised that project does get created fine in Project Online but the same code fails in Project Server on-premises installation (SP1 but no further CUs applied).

    Here is the relevant code

    ProjectCreationInformation newProj = new ProjectCreationInformation();

    newProj.Id = Guid.NewGuid();
    newProj.Name = "My New Project";

    PublishedProject newPublishedProj = _projContext.Projects.Add(newProj);
    QueueJob qJob = _projContext.Projects.Update();


    DraftProject prjDraft = newPublishedProj.CheckOut().IncludeCustomFields;

    [Set mandatory custom field values]

    var job2 = prjDraft.Publish(true);

    Hammad Arif EPM Advice Blog

    Thursday, June 25, 2015 9:59 AM
  • Thank you for your answer Hammad.
    I ended up rewriting the code from CSOM to PSI/WCF and it worked well

    Thursday, June 25, 2015 12:03 PM
  • I had a similar error and just figured out the cause. 

    In project server, we have custom fields (Finish Date and  Project Phase) which were both required. You can check those custom fields by going to PWA Settings -> Enterprise Custom Fields and Lookup Tables. 

    Just change those fields to Not required and run your code again. The error should be gone. Find out how to include those custom fields in some other way.

    Hope this helps! 

    Friday, July 8, 2016 10:08 PM
  • Hi Hammad,

    I'm getting the same problem but i'm using Project Server 2016!

    If change field for not required its work, but i need this custom field to be required...

    Thursday, August 31, 2017 11:22 AM
  • Hi Hammad ,

    I am stuck with this.

    Could you please give an example how to set mandatory custom filed values .

    Tuesday, May 7, 2019 8:00 AM