$(document).ready(function () {
$('.btn-default').on("click", function () {
if (confirm('Are you sure you want to remove this case?')) {
// Deactivate Case!
function DeactivateAccountRecord(){
var entity = {replacewithlogicalnameofentity};
entity.statecode = 1;
entity.statuscode = 706040001;
Xrm.WebApi.online.updateRecord("replacewithlogicalnameofentity", entity.id, entity).then(
function success(result) {
var updatedEntityId = result.id;
},
function(error) {
Xrm.Utility.alertDialog(error.message);
}
);
}
console.log('The case was removed.');
} else {
// Do nothing!
console.log('The case was not deleted');
}})})