Hello,
I am writing javascript to call function on change of Business Process Flow. So in order to achieve above i have registered addOnStageChange() event as shown below:
//Function to call on-load
onLoad(executionContext: any, lockOrderFlagName: string, myAbilityFlagName: string, configRecordName: string) {
let functionName: string = "onLoad";
let formContext: any = null;
try {
//Form Context
formContext = executionContext.getFormContext();
//Add Stage Change event
formContext.data.process.addOnStageChange(() => objSalesOrder.onStageChange(executionContext, lockOrderFlagName, myAbilityFlagName, configRecordName));
}
catch (ex) {
objSalesOrder.throwError(functionName, ex);
}
}
Issue:
Every time change the BPF Stage the above handler i.e. objSalesOrder.onStageChange is executed twice.
Any help will be appreciated!
Thanks!