Thanks Neil. I changed the code to this and it now works: Xrm.Page.data.process.addOnStageChange(StageSelected); function StageSelected() { var activeStage = Xrm.Page.data.process.getActiveStage().getName(); if(activeStage == "Develop") { alert(activeStage); Xrm.Page.getAttribute("new_status").setValue(1); } if(activeStage == "Contract") { alert(activeStage); Xrm.Page.getAttribute("new_status").setValue(2) } }
↧