none
PS 2007 PSI "CustomFieldRequiredValueNotProvided" error on adding Project Custom Field values RRS feed

  • Question

  • Hi,

    I am adding values to custom fields of newly created work plan using PSI. I am able to add values for Text fields but not for Number fields. I am getting error as "CustomFieldRequiredValueNotProvided".

    When I tried to get more info on this then found that when I open work plan in Project Professional, it shows "0" (Zero) value for Number Custom Fields.

    Please advice me how to update Project custom field of Number Type. I am working with MS Project Server 2007.

    Thanks in Advance.

    ...Ajju  

     

    Monday, June 20, 2011 11:14 AM

Answers

  • You are welcome Ajju :)

    Please mark the reply as answer as It will help other if they run into same issue.

    Cheers,


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    • Marked as answer by Ajjudesh Tuesday, June 21, 2011 10:53 AM
    Tuesday, June 21, 2011 4:51 AM

All replies

  • Hello Ajju,

    You can use the method which is for PS2010 but you can get the same information in PS 2007 :

    http://msdn.microsoft.com/en-us/library/gg204768.aspx

    Also, you can find something useful 

    http://amitkhare82.blogspot.com/2011/06/update-project-level-multiline-text.html

     

    ProjectWebSvc.ProjectDataSet.ProjectCustomFieldsRow newCFrow = projectDs.ProjectCustomFields.NewProjectCustomFieldsRow();
    newCFrow.SetNUM_VALUENull();
    newCFrow.SetFLAG_VALUENull();
    newCFrow.SetDUR_VALUENull();
    newCFrow.SetDUR_FMTNull();
    newCFrow.SetDATE_VALUENull();
    newCFrow.SetCODE_VALUENull();
    newCFrow.SetTEXT_VALUENull();
    
    newCFrow.MD_PROP_UID = CfDataTable.MD_PROP_UID;
    newCFrow.CUSTOM_FIELD_UID = Guid.NewGuid();
    newCFrow.PROJ_UID = projGuid;
    newCFrow.FIELD_TYPE_ENUM = CfDataTable.MD_PROP_TYPE_ENUM;
    // Where lookupTableTreeUid is the LT_STRUCT_UID of the LookupTableTreesRow (the code is too long to be inserted here)
    newCFrow.CODE_VALUE = lookupTableTreeUid;
    
    projectDs.ProjectCustomFields.AddProjectCustomFieldsRow(pcfRow);


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    Monday, June 20, 2011 11:57 AM
  • Hi Amit,

    Thanks for the reply. I believe that, since Number Field has a "0" (Zero) value defaulted, it is not adding assigned value and return error as "CustomFieldRequiredValueNotProvided".

    Here is my code...

    --------------------------------------------

    newCfRow.SetFLAG_VALUENull();
    newCfRow.SetDUR_VALUENull();
    newCfRow.SetDUR_FMTNull();
    newCfRow.SetDATE_VALUENull();
    newCfRow.SetCODE_VALUENull();

    newCfRow.CUSTOM_FIELD_UID = Guid.NewGuid();
    newCfRow.PROJ_UID = ProjectGuid;
    newCfRow.MD_PROP_UID = CF_MD_PROP_UID;
    newCfRow.MD_PROP_ID = CF_MD_PROP_ID;
    newCfRow.FIELD_TYPE_ENUM = CF_Type_ENUM;
     newCfRow.SetNum_VALUE = (decimal)myNumbervalue;
    newCfRow.SetTEXT_VALUENull();

     ProjectDS.ProjectCustomFields.AddProjectCustomFieldsRow(newCfRow);
    ------------------------------------------------

    Do I need to provide value for Number field in other format? or do i need to set value for other fields in CF row?

    Thanks in Advance.

    -- Ajju 

     

    Monday, June 20, 2011 12:27 PM
  • Hey.. Thanks Amit..

    It is done..

    I was not setting up CF row Num Value... now i realized and I am able to add Number CF values..

    --- Ajju

    Monday, June 20, 2011 1:46 PM
  • You are welcome Ajju :)

    Please mark the reply as answer as It will help other if they run into same issue.

    Cheers,


    Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82
    • Marked as answer by Ajjudesh Tuesday, June 21, 2011 10:53 AM
    Tuesday, June 21, 2011 4:51 AM