0

I am tasked with retrieving OData from a Microsoft Project server. Following Querying OData feeds for Project reporting data I have been able to retrieve all of the default Microsoft Project fields for each project. Each default field column can be found in the metadata on project server.

Now I need to access the custom fields for the objects at each level. I have used the linq and context below:

WebDCWater.ProjectOData.ReportingData context = 
             new WebDCWater.ProjectOData.ReportingData(new Uri(PSDATA, UriKind.Absolute));

var proj = context.Projects
            .OrderBy(p => p.ProjectName).Select(p => p).FirstOrDefault();

This query gets me the default column values for each project (ProjectEndDate, ProjectDuration, ProjectName, etc). However, I need to access custom fields that are not found in the metadata.

How can I expand my service reference to include custom fields? Is there something that needs to change on the project-server side?

According to MSDN, custom fields and relationships should be included in the service reference:

When you set a service reference to ProjectData, or query ~/ProjectData/$metadata, the Entity Data Model (EDM, or OData schema) includes custom field properties at the time the reference is made.

objectively C
  • 960
  • 9
  • 25
  • As stated in the MSDN documentation, custom field properties are generated at the time reference is made. Custom field properties were added after...? Did you try to refresh it? Reference: https://msdn.microsoft.com/en-us/library/bb628652.aspx#Updating a Service Reference – mtheriault Feb 08 '18 at 14:21
  • @mtheriault I read that. However for me the service creates a reference to the values in the Metadata. But it does not create anything for the custom fields. I have refreshed and created a new reference but only the metadata fields are being captured. – objectively C Feb 08 '18 at 14:23

0 Answers0