Create update and Delete D365 CRM Record From JavaScript API
In this tutorial, you can learn how to Create Updates, and delete Dynamic CRM records from Client API Reference.
Create Record (Client API reference)
var data = {
"name": "dynamics crm",
"description": "dynamics crm 365 blog",
}
//Create account record using WebAPI
Xrm.WebApi.createRecord("account", data).then(
function success(result) {
console.log("Account created Id:" + result.id);
},
function (error) {
console.log(error.message);
});
Update Record (Client API reference)
var GUID="106asda-40as-98as-ADASD554545DA";
var data={
"name" :"dynamics crm",
"description" : "dynamics crm 365 blog",
}
//Update account record using WebAPI
Xrm.WebApi.updateRecord("account",GUID,data).then(
function success(result){
console.log("Account updated");
},
function(error){
console.log(error.message);
});
Delete Record (Client API reference)
var GUID="106asda-40as-98as-ADASD554545DA";
Xrm.WebApi.deleteRecord("account",GUID).then(
function success(result)
{
console.log("Account deleted");
},
function(error){
console.log(error.message);
}
);