Hello everyone,
I am writing some code with the aim of reading data via the OData service of D365 FO. In the past I have already gained some experience with the mentioned features. For example, I read the metadata and get the relevant information about the available DataEntities.
Normally I can read data from the DataEnties by constructing the request accordingly. I am now attaching an example that already works:
GET {{d365_url}}/data/EngineeringChangeOrderHeaders(OrderNumber='0001',dataAreaId='demf')?cross-company=true
Extract from the metadata:
<EntityType Name="EngineeringChangeOrderHeader">
<Key>
<PropertyRef Name="dataAreaId" />
<PropertyRef Name="OrderNumber" />
</Key>
...
</EntityType>
As you can see, the corresponding URL is filled with the keys of the EntityType. This works for the majority of entities. However, this error is always returned for the entity I want to read (ProductDocumentAttachment):
"No HTTP resource was found that matches the request URI '{{d365_url}}/data/ProductDocumentAttachments(ProductNumber='000666',DocumentAttachmentTypeCode='URL',AttachmentDescription='URL20240709-091930',AttachedDateTime='2024-07-09T07:19:31')'. No route data was found for this request."
The corresponding metadata entry shows the keys to be used:
<EntityType Name="ProductDocumentAttachment">
<Key>
<PropertyRef Name="ProductNumber" />
<PropertyRef Name="DocumentAttachmentTypeCode" />
<PropertyRef Name="AttachmentDescription" />
<PropertyRef Name="AttachedDateTime" />
</Key>
...
</EntityType>
Now to my actual question / my actual questions:
- How can I find out which HTTP resources are available?
- Can I assume that this is how the HTTP requests are put together?
- Is there any official documentation on this, and if so, where? (Unfortunately I have not found anything after hours of internet research)
- Can I somehow debug this “mapping” between HTTP request and entity?
Thank you very much for your help!
With kind regards
Christian