Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Updating Virtual Entity Record from Javascript using web api query gives error

Posted on by 20

Hi Guys, 

I am having this issue with updating data from Azure SQL . I created a virtual entity in dynamics to retrieve data from azure sql , data is displayed but I want to update a field from this entity. I created plugins for retrieve, update and retrieve multiple. But when I want to update the record, I get the following error: 

This is the error in browser console: "PUT https://xxxxxxxx.powerappsportals.com/_api/abcd_custompersons(XXXXXXXX-6XXX-4XXX-AXXX-XXXXXXXXXXXX)/updatedemail 400 (Bad Request)

entity name: abcd_customperson

field: updatedemail (it is just a text field )

This is the error code: "9004010D" and the message: "Common Data Service error occurred." 

This is my code for updating 

 webapi.safeAjax({ 
        type: "PUT",
        url: "/_api/abcd_custompersons("   guid   ")/updatedemail",
        contentType: "application/json",
        data: JSON.stringify( {"value": email }),
        success: function (res) {
            console.log(res);
        },
        error: function (res, exception) {
            console.log(res.status   exception);
        }
    });

this entity has table permission in portals to read and write . 

Hope you can help me or give me an idea that i can try it. 

  • Victor carlos Profile Picture
    Victor carlos 20 on at
    RE: Updating Virtual Entity Record from Javascript using web api query gives error

    I have tried with PATCH , but still not working

  • Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: Updating Virtual Entity Record from Javascript using web api query gives error

    I would try with the PATCH syntax instead of the single property update you ate doing

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans