Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

Switch Business Process Flow via Workflow

Posted on by 395

Dear all,

referring to this https://community.dynamics.com/crm/b/crmpowerobjects/archive/2016/12/06/change-business-process-flows-using-a-workflow

I just setup my own workflow without having any issues. The System also says that the worklfow was successfully and even on the record itself it says that the new BPF was started.

You see that the current BPF is the default one and still is.

But you see also the COPY was started today which is the one I want to apply via workflow if any options set changes.

So in the backend I guess it worked BUT on the record itself it still shows the current / selected one? So why is CRM not switching to the new one called copy?

Side notes: I can do it manually. And the 3rd one in the picture is currently the default one in the order (has a different name but I hide it) and the selected one was the original default one and is the managed BPF.

BPF.png

Any ideas why it´s not switching on the record to the COPY BPF?

Cheers 

Patrick

  • Verified answer
    Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Switch Business Process Flow via Workflow

    Dear fun,

    when using a background wf it just does nothing in my mind. Using a real-time wf solved my issue but doesn´t reload the form automatically.

    So what we can do is the following:

    when option set is changed to X -->  start a real-time workflow

    change business process flow and field changes

    bpf will be switched in the background but doesn't appear on the form

    refresh the page --> see the new bpf applied.

    I think that you can run a JS to force reload the form on switching the bpf but don't know why by default.

    In the meantime, I read for sure all your suggestions but couldn't follow your last approach.

    And in my mind, it´s not possible to have a parallel business process flows per record.

    EDIT:  https://experience.dynamics.com/ideas/idea/?idea=808620 following this thread it does not seem possible to change the bpf in the real time worklfow so you have to refresh the form via script.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Switch Business Process Flow via Workflow

    Hi,

    you can use below scenario to test.

    First

    - use user 1 to create the record, but do not open the record via user 2.

    - under main view, run the workflow using user 2.

    - after workflow ran, immediately open the record.

    - user 2 still see original bpf.

    Second

    - use user 1 to create the record, open the record via user 2.

    - under main view, run the workflow using user 2.

    - after workflow ran, wait for a while, then open record using user 2.

    - user 2 still see original bpf.

    Third

    - use user 1 to create the record, do not open the record  via user 2.

    - under main view, run the workflow using user 2.

    - after workflow ran, wait for a while, then open record using user 2.

    - user 2 will see the newly switch bpf.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Switch Business Process Flow via Workflow

    Hi,

    I've tested in my environment.

    are you using background workflow? if yes, the reason why your user still see original workflow, because he/she opened the record before or after the workflow run(immediately).

    To solve this issue, you need use js to switch the process when user open the record.

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Switch Business Process Flow via Workflow

    That´s what I did but we both saw then the same BPF. So I think that there aren't parallel bpf´s on the same record. Doesn't make sense for me anyway. But I still cannot run the workflow when changing an option set field. The bpf starts but does not appear on the form... It´s probably a bug?

    Thanks

    Patrick

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Switch Business Process Flow via Workflow

    Hi,

    can you create an opportunity as user 1 , and use user 2 to switch the bpf and open up the record using user 2.

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Switch Business Process Flow via Workflow

    Well, I just tried it again, activated audit and it tracks just nothing.

    When I click on "Switch Process" I see, that the new BPF which should be applied by the WF is started by myself but on the form nothing happens :/

    Any ideas? Could you already find the time to investigate, Fun?

    Patrick

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Switch Business Process Flow via Workflow

    Hi,

    did you enable audit for lead? if yes , can you check the audit? did it change to copy bpf and after that change back to original bpf?

    i will test this tomorrow on my environment.

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Switch Business Process Flow via Workflow

    Me myself as Sys Admin

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Switch Business Process Flow via Workflow

    Hi,

    who is the owner of this workflow?

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Switch Business Process Flow via Workflow

    WF.png

    Properties: Set the new BPF and Choose required entity Lead (Lead).

    Patrick

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 288,768 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,985 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans