0
votes

I have a scenario in the Business process flow to not to move to the next stage until it satisfies the condition in the current stage.

I have 5 stages and in each stage, I have a condition to meet. Once it is met, the BPF should allow it to move on to the next stage.

I have created a workflow based on the below URL and it worked fine.

URL: https://survivingcrm.com/2013/11/using-real-time-workflows-to-show-error-messages/

But now I'm facing another issue. Business Process Flow is not allowing me to save on the first stage if it is not approved. There is a scenario if all the fields in that first stage are filled, then make the status as Approved, or else "waiting for the information from Contact" (or) "waiting from Customer" option needs to be selected.

When I'm selecting one of these options and click "SAVE", it is showing the error "You cannot move to next stage............", but actually here I'm not moving to the next stage, but just saving the information.enter image description here

1
your workflow is probably firing at wrong trigger. What I would suggest is deactive workflow for now and then try saving, It shall work. Then go back to workflow and check condition when it should trigger, Go one step at a time so that you can narrow down your issue. - AnkUser
were you able to solve your problem? - Arun Vinoth

1 Answers

0
votes

My recommendation is not to spread the logic in different places and that too some in client side, some in server side, mixing up with sync/Async workflow, Plugins, business rules, JavaScript, etc.

For such validations, I simply rely on JavaScript. We can attach functions to addOnStageChange event and show form notifications on failed validations.

Xrm.Page.data.process.addOnStageChange(yourFunction);