Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Changing BPF stage on change of option set value

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
    Ran Zhang 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
    Bipin D365 28,964 Super User 2024 Season 1 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans