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 

  • Suggested answer
    Ran Zhang Profile Picture
    on at
    RE: Changing BPF stage on change of option set value

    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.

  • Suggested answer
    Bipin D365 Profile Picture
    28,961 Moderator on at
    RE: Changing BPF stage on change of option set value

    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,278 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,983 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans