none
CSOM - Read Project Custom Field (Lookup) Value RRS feed

  • Question

  • Dear All,

    How do I read the project custom field (lookup) values using CSOM. My code as follows:

    projContext.Load(projContext.Projects);
    projectContext.ExecuteQuery();
    foreach (PublishedProjectpubProj in projContext.Projects)
    {
        projContext.Load(pubProj.CustomFields);
        projContext.ExecuteQuery();
        foreach (CustomFieldcf in pubProj.CustomFields)
        {
            string intname = cf.InterName.ToString();
            string cf_value = pubProj[intname].ToString();  // threw an exception here
    ....

    My guess is I am missing some steps in order to obtain the lookup value information.

    Thanks,
    Woon Woon, Gan




    Wednesday, August 14, 2013 8:17 AM

Answers

  • Actually, as far as I know PSI does not work with the O365. I tried it also but some how could not make it work. instead i used the CSOM to read the lookup table value.

    Here is the link to my blog where i have mentioned how to do it using CSOM.

    Project Lookup

    PS: When you use the Project to read the related custom field, use the Draft project and While you check out the project, please include the CustomField.


    Thanks, Parth

    • Proposed as answer by Parth Rawal Thursday, December 26, 2013 9:07 AM
    • Marked as answer by Woon Woon, Gan Thursday, December 26, 2013 9:22 AM
    Thursday, December 26, 2013 9:07 AM

All replies