I have been using PSI to read task values from MS Project Server into my application. Now that MS Project Online 2013 no longer supports PSI, I am developing CSOM code to do the same thing. I may be overlooking something simple, but I cannot see how to gain access to local custom fields such as Text1-30, Flag1-20, Number1-20, etc. These fields are populated and clearly have values when I open my Project Online 2013 projects in the browser or in MS Project Pro, but I cannot see them in CSOM! In PSI, for on-premises Project Server 2013 or 2010, these field values for a task are stored in the TaskCustomField table, but I see nothing similar in the CSOM namespace. Watching CSOM read tasks in the debugger, when I examine each PublishedTask, I see a standard set of fields, but no Flag20 or Text30. Also, when I look in the Task.CustomFields and in the dictionary PublishedTask.FieldValues, I do not see them. I've searched the Microsoft documentation, StackOverflow and googled all over the place but have found no mention of this omission. Furthermore Microsoft does not mention omission of local custom fields in the article'What the CSOM Does and Does Not Do'. Am I overlooking something simple in the way I do my Load statements, or did Microsoft omit these important fields from the CSOM interface?
Here, in VB.Net, is the code I am using to gain access to the PublishedTasks. Can anyone see something that would bring in Flag20 and Text30?
mProjContext.Load(mProjContext.Projects, Function(c) c.Where(Function(p) p.Id = projGuid)) mProjContext.ExecuteQuery() If mProjContext.Projects.Count = 1 Then Dim proj As PublishedProject = mProjContext.Projects.First() mProjContext.Load(proj.ProjectResources) mProjContext.Load(proj.Tasks, Function(c) c.IncludeWithDefaultProperties( Function(t) t.CustomFields.Include( Function(f) f.Id, Function(f) f.InternalName, Function(f) f.Name ), Function(t) t.Assignments ) ) mProjContext.ExecuteQuery() Return proj.Tasks End If
...Jim Black