Home › Dynamics 365 Customer Engagement (CRM) › Delete a Record using Xrm.WebApi in Dynamics 365
Dynamics 365 Customer Engagement (CRM) · Aug 7, 2018 · 1 MIN READ

Delete a Record using Xrm.WebApi in Dynamics 365

To delete a record, we can use the syntax below. For example, to delete an account:

[sourcecode language=”JavaScript”] var Id = "26d4ad90-44d1-ea11-a812-000d3a377e2b"; // your record to delete
Xrm.WebApi.online.deleteRecord("account", Id).then(
function success(result) {
console.log("Record deleted");
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);
[/sourcecode]

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.