Business process flow using javascript?

0
52
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


I am tracking the stages of Business process flow and setting the field values,

convert this to Form context format;

function formonload() { 

Xrm.Page.data.process.addOnStageChange(getStage);  // Trigger the function when move to next stage.

getStage();
}
function getStage() {

var activeStage = Xrm.Page.data.process.getActiveStage();

var stagename = activeStage.getName();

switch (stagename) {

case “Stage1”: // Stage of business process flow
Xrm.Page.getAttribute(“field_1”).setValue(1);
break;

case “Stage2”: //Stage of business process flow
Xrm.Page.getAttribute(“field_1”).setValue(2);
break;
default:

}
}



Source link

Leave a reply

Please enter your comment!
Please enter your name here