
Announcements
I have problems when I want to change the status field from active to inactive. I have the table/entity person, and when I click in the button trash I want to change there status, I don't want to delete people.
If I try to Set the value status but appear an error.
If you are changing the status of a record from both active to inactive you need to update both the status (statecode) and status reason (statuscode) values of the record, not just the status.
var data = { “statecode”: statecode, “statuscode”: statuscode };
Xrm.WebApi.updateRecord(entityLogicalName, id, data).then(
function success(result) { executionContext.data.refresh(true); },
function (error) { executionContext.data.refresh(true); }
);
Should work