Select Business Process Flow Stage onChange of a Field Value

1.5k views Asked by At

I am trying to update a business process flow stage using Workflow or JavaScript.

First I tried with JavaScript using below method,

Xrm.Page.data.process.moveNext(onSetActiveStage);  

But the problem with this method is if the active stage is greater than the required selected stage then moveNext logic will not work.

I know I can use movePrevious as well but it will be another overhead as sometime the active stage will be before the required stage and sometime it will be after.

The other option for me was on some field change I can use a workflow to activate or select a stage on business process flow.

For that I created a workflow and selected my BPF as my entity and selected a field on Process Change.

enter image description here

And inside my Set Properties, I set Active stage as the required stage which I want to mark as active.

The above logic is not working for me on change of the field.

I am new to BPF, please bear with me if I am making some basic mistake.

1

There are 1 answers

0
Arun Vinoth-Precog Tech - MVP On

If you are following this blogpost, the comments below the post says - it's not working/triggering for custom BPF and you have to refresh the form to see the changes. Make sure if this is what affecting you.

Also you can un-check the "Workflow Job Retention" checkbox for troubleshooting to see if its triggering or not.

enter image description here

Btw, your design seems to be little confusing, required stage before/after active stage does not makes sense. You may need to add the different branch and "Data step" to make it required in different scenarios.

If this is not feasible, then try to use scripting to set the active stage or plugin/custom action to set the stage on your trigger.