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

Announcements

Community site session details

Community site session details

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

Unable to Update Document Attachment Fields via OData REST API

(0) ShareShare
ReportReport
Posted on by

Product

Microsoft Dynamics 365 Finance & Operations

Problem Type

Data Entities / OData Integration

Environment

  • Entity: EcoResReleasedProductDocumentAttachmentEntity

  • Public Collection Name: ReleasedProductDocumentAttachment

Issue Summary

We are unable to update (PATCH) document attachment fields such as Notes and AttachmentDescription on the ReleasedProductDocumentAttachments OData entity. CREATE (POST), READ (GET), and DELETE operations work successfully.

Steps to Reproduce

  1. Create a document attachment on a Released Product using POST

    POST {{server-url}}/data/ReleasedProductDocumentAttachments
    

    Result: ✅ Success

  2. Read the attachment using GET:

    GET {{server-url}}/data/ReleasedProductDocumentAttachments?$filter=ItemNumber eq '100'
    Result: ✅ Success
  3. Attempt to update Notes using PATCH:

    PATCH {{server-url}}/data/ReleasedProductDocumentAttachments(dataAreaId='Id',ItemNumber='100',DocumentAttachmentTypeCode='File',AttachmentDescription='test',AttachedDateTime=2026-02-20T06%3A20%3A53Z)
    Body: { "Notes": "Updated note text" }
    Header: If-Match: *

    Result: ❌ Error

  4. Delete the attachment using DELETE:

    DELETE {{server-url}}/data/ReleasedProductDocumentAttachments(dataAreaId='Id',ItemNumber='100',DocumentAttachmentTypeCode='File',AttachmentDescription='test',AttachedDateTime=2026-02-20T06%3A20%3A53Z)

    Result: ✅ Success

Error Message

{
  "error": {
    "message": "An error has occurred.",
    "innererror": {
      "message": "Write failed for table row of type 'EcoResReleasedProductDocumentAttachmentEntity'. Infolog: Error: Operation not supported.."
    }
  }
}
Issue Summary

Root Cause Analysis
1. EcoResDocumentAttachmentEntity explicitly blocks updates
The base entity EcoResDocumentAttachmentEntity has the following update() method that throws an error unconditionally:
// EcoResDocumentAttachmentEntity.update()
public void update()
{
    throw error('@SCM:EcoResDocumentAttachmentEntityOperationNotSupported');
}
Since EcoResReleasedProductDocumentAttachmentEntity extends EcoResDocumentAttachmentEntity, it inherits this behavior. This means no document attachment entity that extends this base class can support PATCH/UPDATE via OData.

2. DocuRefEntity supports updates for whitelisted fields but is NOT public
The DocuRefEntity has a proper whitelisted update mechanism:
// DocuRefEntity.update()
// "Updating records through this data entity is not supported for fields not whitelisted."
// "Notes, Name and Restriction fields are whitelisted."
However, DocuRefEntity has IsPublic = No, so it is not exposed via OData and cannot be accessed through the REST API.

3. Overlayering is not available
DocuRefEntity belongs to the Application Foundation package, which is sealed. Overlayering is disabled and IsPublic cannot be changed via extension.

4. D365 UI uses an internal API
The D365 web UI updates attachment fields through the internal ProcessMessages form messaging system, which is session-based and not not sure if accessible externally.

5. Summary of the gap
There is a design gap where:
The public entity (EcoResDocumentAttachmentEntity) blocks updates
The entity that supports updates (DocuRefEntity) is not public
The package is sealed, so neither can be modified without a custom entity

Questions

  1. What is the recommended approach to update Notes and Description fields on document attachments via OData/REST API?

  2. Is there a plan to make DocuRefEntity public (IsPublic = Yes) in a future update, or to enable PATCH support on document attachment entities like EcoResReleasedProductDocumentAttachmentEntity?

  3. Is creating a custom entity (based on DocuRefEntity) the recommended approach for this scenario? If so, are there any guidelines or best practices?

  4. Is the Delete and Re-create pattern (DELETE existing record, then POST a new one with updated fields) an acceptable workaround for production use.

PATCH req.png
Categories:
I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    238,687 Most Valuable Professional on at
    Moved from Integration, Dataverse, and general topics forum to Finance | Project Operations, Human Resources, AX, GP, SL forum.
     
    The error message is correct - the data entity do not support updates. This explicitly implemented in update() method of EcoResDocumentAttachmentEntity.
     
    Regarding your questions:

    1. What is the recommended approach to update Notes and Description fields on document attachments via OData/REST API?
    You can delete a record and create a new one with new values.
     
    2. Is there a plan to make DocuRefEntity public (IsPublic = Yes) in a future update, or to enable PATCH support on document attachment entities like EcoResReleasedProductDocumentAttachmentEntity?
    Making DocuRefEntity is unlikely. DocuRef entity is considered internal and shouldn't be used directly. It's intended to be used as a data source of other entities (such as CustomerAttachmentV2), which may be public. I'm sure why EcoResDocumentAttachmentEntity doesn't support any update at all; I can imagine some fields being updatable.
     
    3. Is creating a custom entity (based on DocuRefEntity) the recommended approach for this scenario? If so, are there any guidelines or best practices?
    See above.
     
    4. Is the Delete and Re-create pattern (DELETE existing record, then POST a new one with updated fields) an acceptable workaround for production use.
    Yes, in my opinion.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 671 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 365 Super User 2026 Season 1

#3
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans