Hello there!
I'm currently developing a Model Driven Apps with a Business Process Flow. Now I got the requirement of advance the BPF to the next stage from the main view of the entity. I created a custom button in the command bar in order to achieve that.


The goal for this button is to select multiple records and advance their stage. Notice that I pass "PrimaryControl" parameter to get the executionContext of the selected records.
I post my JS code:
function BPFMoveNextStageSelected(executionContext) {
//Initiated Form Context
debugger;
var formContext = executionContext;
//Moving BPF to the next stage
formContext.data.process.moveNext(function callBack(result) {
if (result == "stageGate") {
alert("Debe completar los campos obligatorios antes de avanzar de estado");
}
else if (result == "end") {
formContext.data.process.setStatus("finished", function callBackResult(stringRes) {
if (stringRes == "invalid")
alert("Debe completar los campos obligatorios antes de avanzar de estado");
});
}
else if (result == "dirtyForm") {
alert("Debe guardar el formulario para poder avanzar de estado");
}
console.log(result);
});
}
In this code when I access to some attribute inside fromContext variable I get this error in Chrome developer tools:

Any help is appreciated 🙂