Good afternoon. I'm new to programming in dynamics, and I'm trying to simultaneously change the state code and status reason of a particular record. The code is as follows:
ChangeStatusCodeOnApproval: function (primaryControl) {
debugger;
primaryControl.getAttribute ("statecode"). setValue (1);
primaryControl.getAttribute ("statuscode"). setValue (2);
primaryControl.data.refresh (true); }
However, it is not happening as planned. There is only the statecode change, but not the status code change and the refresh does not happen. Any suggestion?