Update a Record using Xrm.WebApi
Let’s look at how we can use the Xrm.WebApi to update a record. Let’s use the Account entity, where we have a field called My New Field (new_mynewfield): Here’s the update script: [sourcecode language=”CSharp”] var data = { "new_mynewfield": "TEST" } var Id = Xrm.Page.data.entity.getId().replace("{", "").replace("}", ""); Xrm.WebApi.updateRecord("account", Id, data).then( function success(result) { console.log("Success"); }, function (error) { console.log(error.message); } ); [/sourcecode] We can run this in the browser console … Continue reading Update a Record using Xrm.WebApi