Hi, I'm trying to prevent a user to be able to go to the next stage. Let's say I have 4 stages in my BPF. The BPF main entity is an opportunity. The first 3 stages of my BPF are related to the opportunity. The 4th stage is related to a custom entity linked to my opportunity. When I'm on my 3rd stage and want to go to the fourth, I want to validate that all the required fields in my opportunity form are filled to let the user go to my fouth stage which is related to my other custom entity.
The required fields (which are numerous) that can prevent from being able to go to next stage are in the opportunity form, but not in the BPF stage.
I tried many ways:
I made a process workflow (on opportunity, not a background one...) that is executed when the stageid changes. For a reason I ignore, the stageid raises each time I change from stage 1 to 3, but when on 3 and aks for the 4th stage, since I swap entity type and the BPF ribbon ask me to create a new entity, the stageid trigger is not hit.
I tried with javascript with methods "Xrm.Page.data.process.setActiveProcess" and "Xrm.Page.data.process.addOnStageChange", but I am not able to catch the moment when I hit the "Next button" stage and before I land on the next stage to prevent the change of stage.
Do someone have an idea on how I can prevent to move to new stage bases on form fields that are not in the current BPF stage?
*This post is locked for comments