Hi,
On the stage change of my business process flow, I want an option set on the form to change to a specific value.
My BPF has two stages, 'Develop' and 'Contract'. When the stage is Develop, I want my option set (called new_status) to be value 1 and when the stage changes to Contract, I want to option set to change to value 2.
Here is my code:
Xrm.Page.data.process.addOnStageChange(StageSelected);
function StageSelected() {
var activeStage = Xrm.Page.data.process.getActiveStage();
if(activeStage.getName == "Develop")
{
Xrm.page.getAttribute("new_status").setValue(1);
}
if(activeStage.getName == "Contract")
{
Xrm.page.getAttribute("new_status").setValue(2);
}
}
I've added this as an onLoad event. I get no error messages, but the option set value does not change.
Any suggestions??
Thanks.