I have some fetchXml that I am executing through the Dynamics CRM Web API. THe fetchXml query is constructed like so:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="new_someEntityA">
<attribute name="new_lookupForSomeEntityA" />
<link-entity alias="new_someEntityB" name="new_someEntityB" from="entityBId" to="entityAId" visible="false" link-type="outer">
<attribute name="new_lookupForSomeEntityB" />
</link-entity>
</entity>
</fetch>
When I send this query through the Web API, I get a response and the value for "new_lookupForSomeEntityA" includes the value (GUID) and a Formatted Value (it's name). But the response for "new_lookupForSomeEntityB" includes just the GUID
and I can't find a way to get it's GUID and value. I've added a header record for:
"Prefer": "odata.include-annotations=OData.Community.Display.V1.FormattedValue"
but that appears to just get me formatted values for the primary entity and not the link entity. Is this a limitation of the Web API or am I doing something wrong? Any help would be appreciated.
Also asked here: http://stackoverflow.com/questions/41028451/not-able-to-fetch-name-of-lookup-fields-of-link-entity-web-api-fetchxml