Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Updating existing record in CDS via API

(0) ShareShare
ReportReport
Posted on by 10

I have seen an error recently with the CDS API when updating existing item in an entity when you have a field in the Patch request (so far I can only figure out 'msdyn_subject'). I'm testing out to update an existing item from the out of the box Project entity (msdyn_project). 

This is the error I received:

{
    "error": {
        "code": "0x80040265",
        "message": "We’re sorry. You cannot directly do 'Update' operation to 'msdyn_project'. Try editing it through the Resource editing UI in Dynamics or via Project."
    }
}

I tried to do the PATCH request via Postman, and if I removed the 'msdyn_subject' field from the request, the API works just fine. Anybody experiencing this issue?

For reference: (Highlighted below is the problematic field)

PATCH https://{ORGURL}.crm6.dynamics.com/api/data/v9.0/msdyn_projects(ab82672e-0bdd-470e-a4a6-1e9372601751)

BODY:

{
    "tdpd_prioritizationstrategicalignment": "441380005",
    "msdyn_subject": "Project Hub App",
    "tdpd_oneplanactuals": 0.0,
    "tdpd_prioritizationlowercost": "441380005",
    "tdpd_oneplanbenefits": 0.0,
    "tdpd_prioritizationrisk": "441380005",
    "tdpd_oneplanforecast": 0.0,
    "tdpd_oneplanbudget": 0.0,
    "tdpd_prioritizationimproveemployeereten": "441380005"
}
  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Updating existing record in CDS via API

    Hi Williams,

    Could you share server and client version of your Dynamics environment?

    Regards,

    Clofly

  • dwilliams123 Profile Picture
    dwilliams123 10 on at
    RE: Updating existing record in CDS via API

    Thanks for your reply. As I have mentioned above, if I removed 'msdyn_subject' from the request body, it works successfully. The issue is the 'msdyn_subject' property when it's part of the request body then it throws that error (I have tried updating 'msdyn_subject' by itself, and it gave the same error). Once it is removed, its all good with the update to the custom fields or whatsoever.

  • cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Updating existing record in CDS via API

    Hi Williams,

    From those two articles:

    https://pwmather.wordpress.com/2020/01/06/extending-projectfortheweb-part4-ppm-cds-msdyn365-powerplatform-msproject-powerapps-powerautomate/

    https://microsoftproject.uservoice.com/forums/914203-project-for-the-web/suggestions/40247386-allow-currency-fields-in-project-for-the-web

    They said that the error is caused due to there is a Currency type field for Project entity.

    However, I added a custom currency field Estimated Value to my Project entity and the PATCH request is still able to be executed successfully.

    pastedimage1600237929914v1.png

    Is there a custom currency field in your Project entity or as the first article mentioned, is there any pre-validation event handler as the part of your Project entity?

    (It seems that all tdpd prefix fields are custom fields.)

    Can you run a simple update operation successfully? e.g: only updating msdyn_subject field.

    Regards,

    Clofly

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans