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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Updating Virtual Entit...
Power Pages
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 5

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: "patch https://xxxxxxxx.powerappsportals.com/_api/abcd_custompersons(XXXXXXXX-6XXX-4XXX-AXXX-XXXXXXXXXXXX) 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 + ")",
contentType: "application/json",
data: JSON.stringify( {"updatedemail": 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. 

Categories:
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @VictorCarlos ,

    i do not use "put", i use "patch" as a verb for updating. Is this already the problem?

    cheers,

      Christian

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @VictorCarlos 

    Instead of creating the plugins, I am using Virtual connectors to achieve the same. It works fab so far on my project. 

     

    Try the below article which will save you some time 

     

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/virtual-entities/create-virtual-tables-using-connectors 

     

    Hope it helps. 
    ------------

    If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

     

  • Victor carlos Profile Picture
    5 on at

    I am sorry, i forgot to update patch word for type. but yes I have tried it with patch and same error. 

  • Victor carlos Profile Picture
    5 on at

    Thanks for the recommendation. I will give it a try . 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 18 Super User 2026 Season 2

#1
Mohsin Ali Profile Picture

Mohsin Ali 18

#3
CU08101843-0 Profile Picture

CU08101843-0 4

Last 30 days Overall leaderboard