none
How to get Value of a custom field task in CSOM Project Server RRS feed

  • Question

  • I am working on a console application for project server. Atm I can read the name and work percent of each task assined to the project. Each task also has a custom field with an unique id.

    How do I get the value of the unique id?

    Here is my code to list the task name and work percent:

    var projColl = projContext.LoadQuery(projContext.Projects
                    .Where(p => p.Name == projectName)
                    .Include(
                        p => p.Name,
                        p => p.Tasks,
                        p => p.Tasks.Include(
                            t => t.Name,
                            t => t.PercentComplete,
                            t => t.CustomFields,
                            t => t.CustomFields.IncludeWithDefaultProperties(
                                    cf => cf.LookupTable,
                                    cf => cf.LookupEntries
                                 )   ) ) ); projContext.ExecuteQuery(); PublishedProject theProj = projColl.First(); PublishedTaskCollection taskColl = theProj.Tasks; int k = 1; //Task counter. foreach (PublishedTask t in taskColl) { Console.WriteLine("\t{0}. {1, -15} {2,-30}{3}", k++, t.Name, t.PercentComplete); }

    I also know the InternalName of the customfield if that helps

    Tuesday, March 12, 2019 11:16 AM