Quantcast
Channel: Second Life of a Hungarian SharePoint Geek
Viewing all articles
Browse latest Browse all 206

Limitations of the $expand REST query option when working with Project Server OData services

$
0
0

Recently I prepared a REST request for the ProjectData service of Project Server. I assembled the following simple query using LINQPad :

from a in Assignments
select new
{
  a.Resource.ResourceCanLevel,
  a.ProjectName,
  a.ResourceName
}

LINQPad sent the following query to the server:

http://yourProjectSite/_api/ProjectData/Assignments()?$expand=Resource&$select=Resource/ResourceCanLevel,ProjectName,ResourceName

The server responded with:

Unsupported query option encountered: $expand

I tried to submit a similar query, but specified exactly the property I needed (used Resource/ResourceCanLevel in place of former value Resource) in the $expand option:

http://yourProjectSite/_api/ProjectData/Assignments?$select=Resource/ResourceCanLevel,ResourceName,ProjectName&$expand=Resource/ResourceCanLevel

The response did not change.

Then – as a last desperate try – I’ve tried to simply omit the $expand option, like this:

http://yourProjectSite/_api/ProjectData/Assignments?$select=Resource/ResourceCanLevel,ResourceName,ProjectName

Of course, I’ve received this message:

Only properties specified in $expand can be traversed in $select query options

The reason and explanation for this behavior I found as a note on MSDN:

The ProjectData service does not implement the $links query option or the $expand query option. Excel 2013 internally uses the Association elements and the AssociationSet elements in the entity data model to help create associations between entities, for pivot tables and other constructs.”

Bad enough… The good news: the ProjectServer service (_api/ProjectServer) has no such limitation.



Viewing all articles
Browse latest Browse all 206

Trending Articles