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 has a custom field with an unique id. It looks like this.
How do I get the value of the unique id? e.g. the 84
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
)
)
);
projContext.ExecuteQuery();
PublishedProject theProj = projColl.First();
PublishedTaskCollection taskColl = theProj.Tasks;
PublishedTask theTask = taskColl.First();
CustomFieldCollection LCFColl = theTask.CustomFields;
Dictionary<string, object> taskCF_Dict = theTask.FieldValues;
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 tried to useConsole.WriteLine("\t{0}. {1, -15} {2,-30}{3}", k++, t.Name, t.PercentComplete,t.CustomFields);
but I only get
Microsoft.ProjectServer.Client.CustomFieldCollection
I also know the InternalName of the customfield if that helps
EDIT: I added this exsample but I only get the values of the first row. Any idea how to loop for every row?