Hello All,
I am stuck in a senario can anyone help.
I have a business process flow which having three option sets field. So,if these three field will be set YES then user only allow to go next stage else need to show error message. "please set field as YES"
I am using below code but not working as expected.
function OnPageLoad() {
Xrm.Page.data.process.addOnStageChange(stageChangeEvent1);
}
function stageChangeEvent1(ExecutionContextObj) {
debugger;
var f = "";
var stageName = Xrm.Page.data.process.getActiveStage().getName();
if (ExecutionContextObj.getEventArgs().getDirection() === "Next") //"previous" for previous stage{
if (Xrm.Page.getAttribute("stageid").getValue() == "6b9ce798-221a-4260-90b2-2a95ed51a5bc" && Xrm.Page.getAttribute("new_flag").getValue() == true) {
if (Xrm.Page.getAttribute("new_cqflage").getValue() == true) {
f += "CQ";
}
if (Xrm.Page.getAttribute("new_pqflage").getValue() == true) {
f += "PQ";
}
if (Xrm.Page.getAttribute("new_rtflage").getValue() == true) {
f += "RT";
}
if (f != null && f != "") {
Xrm.Page.ui.setFormNotification(f + "not found", 'ERROR', 'alert3');
Xrm.Page.data.process.moveNext(function (result) {
return false;
});
}
else {
Xrm.Page.ui.clearFormNotification('alert3');
}
}
}
*This post is locked for comments