web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Changing BPF stage on change of option set value

(0) ShareShare
ReportReport
Posted on by 247

Hello,

I have a requirements of creating a Business Process Flow and I have a field of status reason (out of box field with some custom options in it). The requirement is to change the stage of Business Process Flow according to the change of a value of option set field. For example if I choose value as value 1 in option set then the BPF stage should switch to option1 and if option set field set to option 2 then again BPF stage set to option 2. 

If I set back to option 1 from option 2 in option set value then BPF stage switch back to option 1. Please help me if anybody having a solution on this requirement. Also let me know which method I have to follow to implement this requirement i.e. using BPF UI or using JavaScript code?

Thanks

AR 

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    There is now way to achieve your requirement using only Javascript.

    You can use workflow to change BPF stage based on your field value. Please see below blog which explains the steps to achieve the same.

    vishalgrade.com/.../

    Please mark my answer verified if i were helpful

  • Suggested answer
    Ran Zhang Profile Picture
    on at

    Hi AR,

    I think there is possibility to achieve this. Just register a OnSave method on the form. Call the BPF change method based on OptionSet field.

    var=formContext.getattribute(OptionSet);

    if var=xxx

    then

    In order to achieve this, you have to use the methods formContext.data.process.moveNext and formContext.data.process.movePrevious so you can move back and forth in the active BPF of the form.

       function moveBPFToNextStage(context) {

           var formContext = context.getFormContext();

           formContext.data.process.moveNext();

       }

       function moveBPFToPreviousStage(context) {

           var formContext = context.getFormContext();

           formContext.data.process.movePrevious();

       }

    Besides, you can consider using workflow as well to better meet your requirement.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans