web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Cannot read own created entity in D365FO

(2) ShareShare
ReportReport
Posted on by 97
I was creating my own entity in D365FO. It is an addition to the existing ECO entities managing files. I will post the metadata of my entitiy as an attachment.

When working with the entity in postman. I successfully managed to create an entity using a POST request. I was also able to fetch data (All entities, filtered entities). But when it comes to reading one entity (specified by its keys) I won´t be able to do so. 

This is my request:
{{d365_url}}/data/ChangeOrderProductDocumentAttachments(dataAreaId='demf',EngineeringChangeOrderNumber='000010',EngineeringChangeOrderProductItemId='F00001',DocumentAttachmentTypeCode='File',AttachmentDescription='FileDescription',AttachedDateTime=2025-03-18T13:40:10Z)
 
This is the result:
400 Bad Request
HTTP Error 400. The request URL is invalid.
 
I was using all the keys specified in the entity. If I drop any of the keys the ressource can not be found:
404 Not Found
{
    "Message": "No HTTP resource was found that matches the request URI 'https://cf-demo39616182e12858fd6devaos.axcloud.dynamics.com/data/ChangeOrderProductDocumentAttachments(EngineeringChangeOrderNumber='000010',EngineeringChangeOrderProductItemId='F00001',DocumentAttachmentTypeCode='File',AttachmentDescription='WindchillSoftwareMatrices_12_0_2_0',AttachedDateTime=2025-03-18T13:40:10Z)'. No route data was found for this request."
}
 
Am I doing something completly wrong? The EventViewer was not helpful at all. Online ressources neither. 
I appreciate any help! 
Categories:
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at
    Good morning, afternoon, or evening depending on your location!
     
    Your entity definition confirms that you are using the correct set of primary keys: dataAreaId, EngineeringChangeOrderNumber, EngineeringChangeOrderProductItemId, DocumentAttachmentTypeCode, AttachmentDescription, and AttachedDateTime.

    Possible Reasons for the 400 Bad Request Error
    1. Date-Time Format Issue:
      • The AttachedDateTime key is of type Edm.DateTimeOffset. Try encoding it properly:
        AttachedDateTime=2025-03-18T13%3A40%3A10Z
      • Alternatively, try removing it temporarily to see if the request succeeds.
    2. Data Encoding Problems:
      • If your AttachmentDescription contains special characters (like spaces), encode them properly:
        AttachmentDescription='FileDescription'
      • Ensure the encoding matches OData query standards.
    3. Incorrect Routing or API Version:
      • Verify that the OData endpoint is using the latest version (/data/ or /data/v9.0/ for example).
    4. Debugging Steps:
      • Test with $filter to retrieve just one entity instead of direct lookup:
        {{d365_url}}/data/ChangeOrderProductDocumentAttachments?$filter=EngineeringChangeOrderNumber eq '000010'
      • Check your entity metadata using:
        {{d365_url}}/data/$metadata
      • If possible, confirm that the entity has proper permissions assigned.
     
    Please note: I teamed up with CoPilot AI to research and craft the best response to your question!
    Hope this helps some!
  • CH-11120820-0 Profile Picture
    97 on at
    Hello Holly, 

    I want to reply to each of your suggestions.
     
    1. I confirmed that the AttachedDateTime is encoded properly. I tried another request with "AttachedDateTime" it worked like a charm. Removing it won´t be possible. Since it is a needed value (key).
    2. There are no special chars in my used AttachmentDescription.  
    3. As you can see in the initial post, I am using /data/, so I assume I am using the latest API version.
    4. As I mentioned in the initial post, I was already successful by fetching the data using just a filter. However this won´t help because just reading is not enough for me. I need to also update or delete those values. I double checked the metadata and I can see that the entity is public because I can fetch data using $filter or create an entity with POST.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at
  • André Arnaud de Calavon Profile Picture
    301,171 Super User 2025 Season 2 on at
    Hi,
     
    Can you tell where exactly you make this request? Are you doing this e.g. in a browser or Power Automate?
    Do you get a list of records when you use the custom entity without specifying the key field values?
     
    In case you used the URL in a browser, did you first create a Dynamics 365 F&O session using the F&O URL without /data/...?
    If it works without key fields, check all field names for proper casing. OData is case sensitive.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans